Login-PowerBI -Environment Public #Fill in the Variables $WorkspaceName = 'Test Workspace' #Enter the name of the Workspace to download from $ReportName = @() #Remove all reports for entire workspace - @(). #Otherwise list reports out - @('Report 1', 'Report 2', 'Report 3') $DownloadPath = "C:\examplepath\" #Enter the folder path for the downloaded PBIX, Make sure to end the path with \ as this is a folder path $Workspace = Get-PowerBIWorkspace -Name $WorkspaceName $Count = $ReportName.Count if ($Count -eq 0) { $Reports = Get-PowerBIReport -WorkspaceId $Workspace.Id foreach ($r in $Reports) { $DownloadFile = $DownloadPath + $r.name + ".pbix" # If files already exists, remove it if (Test-Path $DownloadFile) { Remove-Item $DownloadFile } Export-PowerBIReport -WorkspaceId $Workspace.ID -Id $r.ID -OutFile $DownloadFile $TextOutput = "Downloading " + $r.name + ".pbix" Write-Output $TextOutput } } else { foreach ($i in $ReportName) { $Reports = Get-PowerBIReport -WorkspaceId $Workspace.Id -Name $i foreach ($r in $Reports) { $DownloadFile = $DownloadPath + $r.name + ".pbix" # If files already exists, remove it if (Test-Path $DownloadFile) { Remove-Item $DownloadFile } Export-PowerBIReport -WorkspaceId $Workspace.ID -Id $r.ID -OutFile $DownloadFile $TextOutput = "Downloading " + $r.name + ".pbix" Write-Output $TextOutput } } }