Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Error running Powershell Get-PowerBITable

Hello,

I've experienced an error while running the following command:


Get-PowerBITable -DatasetId [My Dataset ID Here] -WorkspaceId [My Workspace ID here] . Error is as follows:

Get-PowerBITable : Operation returned an invalid status code 'NotFound'
At C:\Powershell Tests\Test.ps1:6 char:1
+ Get-PowerBITable -DatasetId ..... -Wor ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...GetPowerBITable:GetPowerBITable) [Get-PowerBITable], HttpOperationException
+ FullyQualifiedErrorId : Operation returned an invalid status code 'NotFound',Microsoft.PowerBI.Commands.Data.GetPowerBITable

 

Please kindly assist.

 

Regards,

Joe

10 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      This is answer!

  • Hi Anonymous 

     

    As the error mentioned the Script couldn't able to find it the one which you are looking

     

    Possible reason:

     

    • Either your datasetid/workspace id is wrong
    • The logged in user (from the powershell session) is not having permission to the workspace/dataset

     

    ~Jay 

    Pls join my upcoming webinar

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jayendran,

      It is strange, because I am setup as the Power BI Service Admin of our tenant.

      I am confident that my datasetid/workspace id are correct (I got it by reading from url or running  Get-PowerBIDataset -Scope Organization)

       

      I am able to run the following and get data without issues: 

      Get-PowerBIDataset -Scope Organization

      Get-PowerBIWorkspace -All

       

      By removing the workspace id, error is : Get-PowerBITable : Operation returned an invalid status code 'Forbidden'. 

       

      Really need help from someone to understand what is happening.

       

      Regards,

      Joe

      • Jayendran's avatar
        Jayendran
        Solution Sage

        Hi Anonymous ,

         

        Ah now it's Forbidden error which means like you are not allowed. Can you try the same script in a new powershell session or window

  • Anonymous's avatar
    Anonymous
    Not applicable

    No, I was not able to find any solutions on that.

  • I am having the same problem, I am a Power BI Admin, when I execute the following command in powershell

    Get-PowerBIDataset -Scope Organization | Get-PowerBITable

    I get "Get-PowerBITable: Operation returned an invalid status code 'NotFound'"

  • I have a same error when I am running Get-PowerBITable -DatasetId  or Invoke-PowerBIRestMethod -Url 'datasets/{datasetId}/tables' -Method Get but I am able to run other admin command