From 6a7b2f5869664a84a88324fd7636eaa6b7087585 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Sun, 2 Aug 2015 11:31:15 -0400 Subject: [PATCH] Workaround for bug in PowerShell Get-Website cmdlet. --- windows/win_iis_website.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/windows/win_iis_website.ps1 b/windows/win_iis_website.ps1 index bba1e941142..26a8df12730 100644 --- a/windows/win_iis_website.ps1 +++ b/windows/win_iis_website.ps1 @@ -70,7 +70,7 @@ $result = New-Object psobject @{ }; # Site info -$site = Get-Website -Name $name +$site = Get-Website | Where { $_.Name -eq $name } Try { # Add site @@ -113,7 +113,7 @@ Try { $result.changed = $true } - $site = Get-Website -Name $name + $site = Get-Website | Where { $_.Name -eq $name } If($site) { # Change Physical Path if needed if($physical_path) { @@ -165,7 +165,7 @@ Catch Fail-Json (New-Object psobject) $_.Exception.Message } -$site = Get-Website -Name $name +$site = Get-Website | Where { $_.Name -eq $name } $result.site = New-Object psobject @{ Name = $site.Name ID = $site.ID