Forum Discussion
jaideepnema
4 years agoSolution Sage
Upload Multiple Files on Power Bi Report Server
We have a requirement to move around 50+ Reports from One Power Bi Report Server Instance to another so i would like to know is there any option so that we can bulk upload more than one file on the ...
jaideepnema
4 years agoSolution Sage
Hi d_gosbell ,
I tried creating a small script to achieve the same functionality as shown below:
$ReportPortalUri = 'http://localhost/reports';
$Session=New-RsRestSession -ReportPortalUri $ReportPortalUri;
Write-RsRestFolderContent -Path "F:\PBIX files\" -RsFolder \BulkUpload -Overwrite -Recurse -ReportPortalUri $ReportPortalUri -RestApiVersion v2.0 -WebSession $Session -Verbose
But this is not working as it gives me the following error:
Write-RsRestCatalogItem : System.Exception: Failed to create catalog item: The remote server returned an error: (422) Unprocessable Entity. --->
System.Net.WebException: The remote server returned an error: (422) Unprocessable Entity.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
--- End of inner exception stack trace ---
At C:\Program Files\WindowsPowerShell\Modules\ReportingServicesTools\0.0.6.6\Functions\CatalogItems\Rest\Write-RsRestFolderContent.ps1:207 char:21
+ ... Write-RsRestCatalogItem -WebSession $WebSession -RestApiV ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-RsRestCatalogItemCan you please help me understand what i am doing wrong ?
TomKK
2 years agoNew Member
I got it to work, after I changed the back slash to forward slash.
\BulkUpload to /BulkUpload