|
|
@ -171,15 +171,21 @@ Catch
|
|
|
|
Fail-Json (New-Object psobject) $_.Exception.Message
|
|
|
|
Fail-Json (New-Object psobject) $_.Exception.Message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$site = Get-Website | Where { $_.Name -eq $name }
|
|
|
|
if ($state -ne 'absent')
|
|
|
|
$result.site = New-Object psobject @{
|
|
|
|
{
|
|
|
|
Name = $site.Name
|
|
|
|
$site = Get-Website | Where { $_.Name -eq $name }
|
|
|
|
ID = $site.ID
|
|
|
|
|
|
|
|
State = $site.State
|
|
|
|
|
|
|
|
PhysicalPath = $site.PhysicalPath
|
|
|
|
|
|
|
|
ApplicationPool = $site.applicationPool
|
|
|
|
|
|
|
|
Bindings = @($site.Bindings.Collection | ForEach-Object { $_.BindingInformation })
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($site)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$result.site = New-Object psobject @{
|
|
|
|
|
|
|
|
Name = $site.Name
|
|
|
|
|
|
|
|
ID = $site.ID
|
|
|
|
|
|
|
|
State = $site.State
|
|
|
|
|
|
|
|
PhysicalPath = $site.PhysicalPath
|
|
|
|
|
|
|
|
ApplicationPool = $site.applicationPool
|
|
|
|
|
|
|
|
Bindings = @($site.Bindings.Collection | ForEach-Object { $_.BindingInformation })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Exit-Json $result
|
|
|
|
Exit-Json $result
|
|
|
|