Trying to parse a url using query params using Microsoft.Graph.Intune module

Copper Contributor


Invoke-MSGraphRequest -Url '$select=id,imei,operatingSystem,ownerType,managedDeviceOwnerType&$filter=(operatingSystem eq ''iOS'')' -HttpMethod GET 


I would like to retrieve this data and the URL works in Postman, but when I run it in VS i get "Cannot validate argument on parameter 'Url'. The provided URL is not valid - the URL may be a relative URL" Any ideas on how I can retrieve this data and use it? Mainly make this request work with Connect-MSGraph

4 Replies
Hi Matthew,

Have you thought about using PowerAutomate? It’s easier than using powershell or Postman, then you can parse the results and use them.

Here is a good guide:


@Moe_Kinani You could also store the output from in a variable and query from there?


$devices.value | Where-Object operatingSystem -Contains 'iOS'

Did you manage to get a report?