I'm trying to figure out how to view the properties of Azure AVD session hosts via script. Instead, all I'm getting is a serialized object. How do I get it to output the properties? I've tried Format-List, but that has no effect.
$resourceGroup = "Group1"
$hostPoolObjects = Get-AzWvdHostPool -ResourceGroupName $resourceGroup
foreach ($hostPool in $hostPoolObjects) {
$sessionHosts = Get-AzWvdSessionHost -HostPoolName $hostPool.Name -ResourceGroupName $resourceGroup
foreach ($sessionHost in $sessionHosts) {
Write-Host $sessionHost
}
}
}
Output:
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api202209.SessionHost
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api202209.SessionHost
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api202209.SessionHost
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api202209.SessionHost
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api202209.SessionHost
Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api202209.SessionHost
...
What am I missing in the code?
Format-Listgives me exactly what I was looking for.