DEV Community

Discussion on: Upload RDL file(s) to Power BI via API

ravadiveeresh profile image
Veeresh Ravadi

This is a great script but my report was empty after uploading then I found out that content type was wrong then I made this change to script

Changed this line: (13)
$fileBody = Get-Content -Path $RdlFilePath -Encoding UTF8

to this
$fileBytes = [System.IO.File]::ReadAllBytes($RdlFilePath)
$encoding = [System.Text.Encoding]::GetEncoding("iso-8859-1")
$filebody = $encoding.GetString($fileBytes)

then my reports were loading fine

kenakamu profile image
Kenichiro Nakamura Author

Thanks for the update!