mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Merge pull request #9824 from willempienaar/devel
Fixed error handling for the enabling of PS Remoting
This commit is contained in:
commit
7145da7ddc
1 changed files with 1 additions and 7 deletions
|
@ -98,13 +98,7 @@ ElseIf ((Get-Service "WinRM").Status -ne "Running")
|
||||||
If (!(Get-PSSessionConfiguration -Verbose:$false) -or (!(Get-ChildItem WSMan:\localhost\Listener)))
|
If (!(Get-PSSessionConfiguration -Verbose:$false) -or (!(Get-ChildItem WSMan:\localhost\Listener)))
|
||||||
{
|
{
|
||||||
Write-Verbose "Enabling PS Remoting."
|
Write-Verbose "Enabling PS Remoting."
|
||||||
Try
|
Enable-PSRemoting -Force -ErrorAction Stop
|
||||||
{
|
|
||||||
Enable-PSRemoting -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
|
||||||
Catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Else
|
Else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue