From 853fa8223a41f07af98de34c9c1d71f9312b2204 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 20 Dec 2017 22:40:55 -0800 Subject: [PATCH] avoid use of Write-Host in config script --- examples/scripts/ConfigureRemotingForAnsible.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/scripts/ConfigureRemotingForAnsible.ps1 b/examples/scripts/ConfigureRemotingForAnsible.ps1 index 4c3e52b5d4..29dc888fb6 100644 --- a/examples/scripts/ConfigureRemotingForAnsible.ps1 +++ b/examples/scripts/ConfigureRemotingForAnsible.ps1 @@ -74,7 +74,7 @@ Function Write-VerboseLog Function Write-HostLog { $Message = $args[0] - Write-Host $Message + Write-Output $Message Write-Log $Message } @@ -196,8 +196,8 @@ $adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator # Check to see if we are currently running "as Administrator" if (-Not $myWindowsPrincipal.IsInRole($adminRole)) { - Write-Host "ERROR: You need elevated Administrator privileges in order to run this script." - Write-Host " Start Windows PowerShell by using the Run as Administrator option." + Write-Output "ERROR: You need elevated Administrator privileges in order to run this script." + Write-Output " Start Windows PowerShell by using the Run as Administrator option." Exit 2 }