Forum Discussion
JuliusPIV
Jan 22, 2024Brass Contributor
How to Escape Special Characters in the -Filter Property of the Get-IntuneManagedDevice Cmdlet?
TL;DR: How do I escape the pound/hash (#) and apostrophe (') characters in the Filter property of the Get-IntuneManagedDevice cmdlet? Full Explanation I'm leveraging the Get-IntuneManagedDevic...
OraDotNetDev
Mar 27, 2024Copper Contributor
Have you tried using the url escaped values for the filter as follows:
%27 - quote
%23 - hash
-Filter "not contains(UserPrincipalName, '%23')"
[uri]::EscapeDataString('''')
[uri]::EscapeDataString('#')