'MSGraph OData filtering on empty collections
I'm using the MS powershell modules for working with MsGraph, but the same rules/principles apply when providing a filter as to what you'd normally just put into the http query string.
I have the following which works okay and lists all 365groups that are teams:
Get-MgGroup -Filter "resourceProvisioningOptions/Any(x:x eq 'Team')"
What I would like to acheive, without having to pull ALL groups and then filtering locally, is basically the opposite of the above, something like this:
Get-MgGroup -Filter "resourceProvisioningOptions/Any(x:x ne 'Team')"
But because I'm doing this against a collection, it throws.
Get-MgGroup_List: Unsupported property filter clause operator 'NotEqualsMatch'.
Now I've tried every which way I an think of to get this to work, I've tried looking for a set of operators that would effectivly filter if resourceProvisioningOptions is null/empty as a collection. But nothing I try will work, I just seem to get errors. Anyone have any ideas?
Thanks, Tom
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|