microsoft / powerbi-powershell

PowerShell community for Microsoft PowerBI. Here you will find resources and source for PowerShell modules targeting PowerBI.
MIT License
349 stars 121 forks source link

New-PowerBIReport Cant handle Space in name or specialcharacters. #376

Open ghost opened 1 year ago

ghost commented 1 year ago

Hi,

Having an issue with this module. New-PowerBIReport. Seems it doesnot handle space in name at all also doesnt handle åäö. I have tried excluding -Name but it doesn't help. Have also tried to Cast as an uri but no success.

No problems with rdl reports that doesn´t have space in the name.

$reportName = 'report demo.rdl'
$reportFile = 'C:\Temp\Reports\report demo.rdl'
$destinationWorkspaceId = 'xxxxxx'
$conflictAction = 'Overwrite'

New-PowerBIReport -Path $reportFile -Name $reportName -WorkspaceId $destinationWorkspaceId -ConflictAction $conflictAction -Verbose

VERBOSE: Request Uri: https://api.powerbi.com/v1.0/myorg/groups/xxxxxxxxxxxxxx/imports?datasetDisplayName=report demo.rdl&nameConflict=Abort VERBOSE: Status Code: BadRequest (400)

ErrorMessage: New-PowerBIReport : Operation returned an invalid status code 'BadRequest'