summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSimon Liddicott <simon+github@liddicott.com>2017-08-06 23:14:56 +0100
committerJordan Borean <jborean93@gmail.com>2017-08-07 08:14:56 +1000
commit3ceeb5124efe286a7273b8136f9793a82da37f84 (patch)
tree350a9adbcccdbed79d51877ea0590f004d2f628f /examples
parent0343ac1a9d60ed8de9b4ff967ab0674a5ff673e7 (diff)
downloadansible-3ceeb5124efe286a7273b8136f9793a82da37f84.tar.gz
Set startup type to automatic before attempting to start the service. Otherwise it will fail if the service is disabled. (#27751)
Diffstat (limited to 'examples')
-rw-r--r--examples/scripts/ConfigureRemotingForAnsible.ps16
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/scripts/ConfigureRemotingForAnsible.ps1 b/examples/scripts/ConfigureRemotingForAnsible.ps1
index b84dc295a4..3b2ddcd512 100644
--- a/examples/scripts/ConfigureRemotingForAnsible.ps1
+++ b/examples/scripts/ConfigureRemotingForAnsible.ps1
@@ -171,12 +171,12 @@ If (!(Get-Service "WinRM"))
}
ElseIf ((Get-Service "WinRM").Status -ne "Running")
{
- Write-Verbose "Starting WinRM service."
- Start-Service -Name "WinRM" -ErrorAction Stop
- Write-Log "Started WinRM service."
Write-Verbose "Setting WinRM service to start automatically on boot."
Set-Service -Name "WinRM" -StartupType Automatic
Write-Log "Set WinRM service to start automatically on boot."
+ Write-Verbose "Starting WinRM service."
+ Start-Service -Name "WinRM" -ErrorAction Stop
+ Write-Log "Started WinRM service."
}