Help with StartsWith filter in Powershell

Copper Contributor

Trying to get a list of Intune Devices from Graph where their names start with "PSY-"

Running the command below in Powershell:

 $uri1 = "`$filter=startswith(Devicename, 'PSY-')"

 $Results = (Invoke-RestMethod -Uri $uri1 -Headers $authToken -Method Get).value

This works but also gives me devices that start with "EPSY-", another department. Shouldn't the StartsWith only get devices that specifically start with "PSY-"?

How can I resolve this?



0 Replies