From d0d4f2e406c4a27c4179fe5ef5791bef90e64a3a Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 26 Sep 2018 13:46:24 +1000 Subject: [PATCH] win_setup: don't fail when running as non-admin and EAP is set to Stop (#46149) --- lib/ansible/modules/windows/setup.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index c6aa882b91..c3614485f0 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -404,7 +404,8 @@ if($gather_subset.Contains('windows_domain')) { if($gather_subset.Contains('winrm')) { - $winrm_https_listener_parent_paths = Get-ChildItem -Path WSMan:\localhost\Listener -Recurse | Where-Object {$_.PSChildName -eq "Transport" -and $_.Value -eq "HTTPS"} | select PSParentPath + $winrm_https_listener_parent_paths = Get-ChildItem -Path WSMan:\localhost\Listener -Recurse -ErrorAction SilentlyContinue | ` + Where-Object {$_.PSChildName -eq "Transport" -and $_.Value -eq "HTTPS"} | select PSParentPath if ($winrm_https_listener_parent_paths -isnot [array]) { $winrm_https_listener_parent_paths = @($winrm_https_listener_parent_paths) }