Format Output as Table with Count

Hi All,

I’m trying to format O365 groups and user count into a table format. I tried ‘ft’, but it’s not outputting as expected:


$ActiveWS = Get-PowerBIWorkspace -Scope Organization -All | Where {($.Type -eq “Workspace”) -and ($.State -eq “Active”)}

ForEach ( $indWS in $ActiveWS )


$indWS.Name, $indWS.Type, $indWS.State | ft -AutoSize



The output is in one column.

Also, I’d like to add a user count next to each workspace. Would that be a for loop to take count?



Actually you don’t need an extra loop …

Get-PowerBIWorkspace -Scope Organization -All |
Where-Object { ($.Type -eq “Workspace”) -and ($.State -eq “Active”) } |
Select-Object -Property Name,Type,State

For the user count you could use a calculated property.