Updated CopyWorkspaceSampleScript to work with personal workspaces

This commit is contained in:
Chaz Beck 2019-09-18 13:17:31 -07:00
Родитель da30bfbcd8
Коммит dc4e38c06b
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -137,7 +137,12 @@ Foreach ($report in $reports) {
Write-Host "== Exporting $report_name with id: $report_id to $temp_path"
try {
Export-PowerBIReport -Id $report_id -WorkspaceId $source_workspace_ID -OutFile "$temp_path" -ErrorAction Stop
if ($source_workspace_ID -eq "me") {
Export-PowerBIReport -Id $report_id -OutFile "$temp_path" -ErrorAction Stop
}
else {
Export-PowerBIReport -Id $report_id -WorkspaceId $source_workspace_ID -OutFile "$temp_path" -ErrorAction Stop
}
}
catch {
Write-Warning "= This report and dataset cannot be copied, skipping. This is expected for most workspaces."