From https://social.technet.microsoft.com/Forums/systemcenter/en-US/d0fcf7c7-b787-441e-be52-2572d76d8c1a/querying-sccm-for-collection-rules-by-powershell?forum=configmgrgeneral
Get-CMDeviceCollection | ? {$_.CollectionRules.RuleName -ne $null} | % {Get-CMDeviceCollectionQueryMembershipRule -CollectionID $_.CollectionID -RuleName $_.CollectionRules.RuleName}