win_setup: don't fail when running as non-admin and EAP is set to Stop (#46149)

This commit is contained in:
Jordan Borean 2018-09-26 13:46:24 +10:00 committed by GitHub
parent 05e3b5d632
commit d0d4f2e406
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}