1

So, I have a code like the following.

$x = Invoke-PowerBIRestMethod -Url 'datasets/<dataset_id>/refreshes' -Method Get

When I run it, the returned JSON data is like this,

{
  "@odata.context":"<some_url>/myorg/$metadata#refreshes","value":[
    {
      ....
    },
    {
      ...
    }
  ]
}

But if I try to get the field value, by typing $x.value, I get nothing. What mistake am I doing. I am new to PowerShell.

mklement0
  • 382,024
  • 64
  • 607
  • 775
MetallicPriest
  • 29,191
  • 52
  • 200
  • 356

1 Answers1

1

The output was in string form. I had to first convert it to JSON form by using the following command.

$j = $x | ConvertFrom-Json

Then I can see the value by typing $j.value

MetallicPriest
  • 29,191
  • 52
  • 200
  • 356