Merge pull request #9824 from willempienaar/devel
Fixed error handling for the enabling of PS Remotingpull/4420/head
commit
7145da7ddc
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue