Skip to content

Commit 27740b9

Browse files
committed
Fix PSAvoidUsingWriteHost
1 parent 481eb49 commit 27740b9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Examples/Backup-CiscoSwitchConfigToTFTPServer.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ Invoke-SNMPv3Set @Request -OID "1.3.6.1.4.1.9.9.96.1.1.1.1.14.$Random" -Type Int
3030

3131
# Display Result
3232
switch ($Value.ToInt32()) {
33-
3 { Write-Host "Success!" -ForegroundColor Green }
34-
4 { Write-Host "Failure!" -ForegroundColor Red }
33+
3 { Write-Output "Success!" }
34+
4 { Write-Output "Failure!" }
3535
}

Examples/Copy-ConfigFileToCiscoSwitch.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Invoke-SNMPv3Set @Request -OID "1.3.6.1.4.1.9.9.96.1.1.1.1.14.$Random" -Type Int
3434

3535
# Display Result
3636
switch ($Value.ToInt32()) {
37-
3 { Write-Host "Success!" -ForegroundColor Green }
38-
4 { Write-Host "Failure!" -ForegroundColor Red }
37+
3 { Write-Output "Success!" }
38+
4 { Write-Output "Failure!" }
3939
}
4040

4141
# Get the new value from sysContact

0 commit comments

Comments
 (0)