This is telling Format-Table to create one column named whatever is in $group.name. The -Properties parameter of Format-Table is a list of columns you want displayed, not the contents of those columns.
AWESOME! Thanks @DonJones for the nice explanation and that created exactly what i was looking for. Is there a way when doing the foreach to have it output everything into a single table, output currently:
GroupName Name
--------- ----
LA-TST3GENAPP01 DP-IT-Admin-DBA-NonProd
GroupName Name
--------- ----
LA-TSTCRDAPP06 DP-TradeOpsTeam-Developer-NonProd
GroupName Name
--------- ----
LA-TSTGENAPP01 DP-IT-Admin-DBA-NonProd
GroupName Name
--------- ----
LA-TSTRPT01 DP-IT-Admin-DBA-NonProd
GroupName Name
--------- ----
LA-TSTSSAS01 DP-IT-Admin-DBA-NonProd
vs. say:
GroupName Name
--------- ----
LA-TSTSSAS01 DP-IT-Admin-DBA-NonProd
LA-TSTRPT01 DP-IT-Admin-DBA-NonProd
Change the Format-Table to Select-Object and try it. The problem now is that you’re creating a new table “foreach group in groups,” right? It’ll default to table format anyway since it’s only two properties.