Skip to content

Commit 853fa82

Browse files
committed
avoid use of Write-Host in config script
1 parent 276f712 commit 853fa82

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/scripts/ConfigureRemotingForAnsible.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Function Write-VerboseLog
7474
Function Write-HostLog
7575
{
7676
$Message = $args[0]
77-
Write-Host $Message
77+
Write-Output $Message
7878
Write-Log $Message
7979
}
8080

@@ -196,8 +196,8 @@ $adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
196196
# Check to see if we are currently running "as Administrator"
197197
if (-Not $myWindowsPrincipal.IsInRole($adminRole))
198198
{
199-
Write-Host "ERROR: You need elevated Administrator privileges in order to run this script."
200-
Write-Host " Start Windows PowerShell by using the Run as Administrator option."
199+
Write-Output "ERROR: You need elevated Administrator privileges in order to run this script."
200+
Write-Output " Start Windows PowerShell by using the Run as Administrator option."
201201
Exit 2
202202
}
203203

0 commit comments

Comments
 (0)