DEV Community

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

Collapse
 
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

Collapse
 
kenakamu profile image
Kenichiro Nakamura

Thanks for the update!