I'm trying get Refresh Logs for each dataset from Power BI rest API with Power Shell script.
Documentation for API https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/getrefreshhistory
But I'm getting below error in power shell. could you please help me ?
At first sight, you should use Invoke-PowerBIRestMethod instead of the generic Invoke-RestMethod. The first one will take care of adding the authorization token in the request for you, which you must add manually when using the generic cmdlet (and you didn't).