1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #9824 from willempienaar/devel

Fixed error handling for the enabling of PS Remoting
This commit is contained in:
Chris Church 2014-12-15 19:57:06 -05:00
commit 7145da7ddc

View file

@ -98,13 +98,7 @@ ElseIf ((Get-Service "WinRM").Status -ne "Running")
If (!(Get-PSSessionConfiguration -Verbose:$false) -or (!(Get-ChildItem WSMan:\localhost\Listener)))
{
Write-Verbose "Enabling PS Remoting."
Try
{
Enable-PSRemoting -Force -ErrorAction SilentlyContinue
}
Catch
{
}
Enable-PSRemoting -Force -ErrorAction Stop
}
Else
{