I have a script that have to recovery some information from an API rest (from powerBI)
This is the code used
Invoke-PowerBIRestMethod -Url “https://api.powerbi.com/v1.0/myorg/groups/XX-XX-XX-XX/datasets” -Method Get |
ConvertFrom-Json |
ForEach-Object {
[PSCustomObject] @{
id = $.id;
Name = $.name;
}
}
unfortunately the returned value are empty.
If I launch the rest api command return correctly a json with several fields, and I need from these fields only id and name.
what’s wrong with this code ?
Also, welcome to the forum.
To make the code easier to read, select the </> icon on your message taskbar and paste your script in there. Comes out like it does in my reply.
Makes it easier to copy and view.