MSTeams: Policy Packages – Manage with PowerShell

########## MSTeams: Policy Packages - Manage with PowerShell
#Dump details (assigned policies) of MS Teams policy packages
#Copyright (c) All Rights Reserved
#www.leedesmond.com 
#2023-02-03 Version: 1.0

Connect-MicrosoftTeams
$ppc=$pp=Get-CsPolicyPackage

#optionally apply filter to customised policy packages only
#Note: limited to MS Teams Premium licensees
$ppc=$pp|Where-Object PackageType -eq 'Custom';

$ppc|%{
     Write-Verbose "$($PsItem.Name)`n$($PsItem.Description)"-Verbose;
     $_i=$PsItem;
     $_i.policies.keys|%{
          Write-Host "$($PsItem)//$($_i.policies[$PsItem].values)";
          $_i.policies[$PsItem].values|%{$_};
     }
}