From 70f7f144e02d2e59e0a1963785107ae9e66e45fe Mon Sep 17 00:00:00 2001 From: Matt Calhoun Date: Tue, 29 Sep 2015 16:37:26 -0400 Subject: [PATCH] The variable $https_listener cannot be retrieved because it has not been set. --- lib/ansible/modules/windows/setup.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index 91100912e44..61b36b27fa4 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -78,6 +78,8 @@ Set-Attr $result.ansible_facts "ansible_powershell_version" $psversion $winrm_https_listener_parent_path = Get-ChildItem -Path WSMan:\localhost\Listener -Recurse | Where-Object {$_.PSChildName -eq "Transport" -and $_.Value -eq "HTTPS"} | select PSParentPath $winrm_https_listener_path = $null +$https_listener = $null + if ($winrm_https_listener_parent_path ) { $winrm_https_listener_path = $winrm_https_listener_parent_path.PSParentPath.Substring($winrm_https_listener_parent_path.PSParentPath.LastIndexOf("\"))