Forum Discussion

crturner's avatar
crturner
Microsoft Employee
3 years ago
Solved

Using Power BI Rest APIs with Filters in Powershell

I am attempting to call the Get Groups REST API in Powershell to obtain a list of all the workspaces I have access to. 

 

$GetWorkspaces = Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/groups/" -Method Get 

 

I would like to add a filter on the workspace name, i.e., only return workspaces that include that word "email" in them. I've used the try it function, and tried to edit the url string, but nothing seems to change the result set from returning every workspace. Appreciate any thoughts!

  • The Try it now feature is great, and I've been testing it, but I was getting syntax errors.

    If anyone else is struggling with this, set the name/value as $filter/contains(name,'text')

5 Replies