Hello I was trying to write a 2 Powershell Script to be able to capture All AppPoolState and All WebSiteState for IIS. But I am stumped with this
[System.Collections.ArrayList]$ApplicationPoolsState = Get-WebAppPoolState | % { return @{($.itemxpath -split ("'"))[1]="$($.value)" } }
$ApplicationPoolsState.keys .NET v4.5 .NET v4.5 Classic DefaultAppPool
But
[System.Collections.ArrayList]$ApplicationSiteState = Get-WebsiteState | % { return @{($.itemxpath -split ("'"))[1]="$($.value)" } }
$ApplicationSiteState.keys
The Second one returns blank. Even Though the array is there > $ApplicationSiteState Name Value ---- ----- Default Web Site Started
What am I missing :(