microsoft / microsoft/powerbi-powershell
Export-PowerBIReport fails with "Wildcard unable to find file" - Workspace has ]'s in name
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 413
- Forks
- 134
- Avg merge
- 33m
- Merged PRs (30d)
- 1
Description
I'm writing a script in powershell (5.4.1 and 7.1.3) with similar results:
HistoryId: 283
Message : Wildcard unable to find file
StackTrace : at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
Exception : System.IO.FileNotFoundException
InvocationInfo : {Export-PowerBIReport}
Line : Export-PowerBIReport –WorkspaceId $Workspace.ID –Id $Report.ID –OutFile $OutputFile
Position : At C:\PBI_BackerUpper_Man\basic_workspace_BU.ps1:53 char:4
+ Export-PowerBIReport –WorkspaceId $Workspace.ID –Id $Repo …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 283
I've narrowed down the failures to workspaces that have "[" or "]" in their name. This occurs whether or not you use Workspace in the command line or not:
Export-PowerBIReport –WorkspaceId $Workspace.ID –Id $Report.ID –OutFile $OutputFile
or
Export-PowerBIReport –Id $Report.ID –OutFile $OutputFile
The script creates directories with "[" or "]" in the names OK, however if the path variable for -OutFile contains either, the error is thrown. I have tried hardcoding the -OutFile path with the same directory names containing the "[ ]"s and it fails as well.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Export-PowerBIReport entry point and reproduce the failure with an -OutFile path containing '[' or ']'. Compare that result with a path without brackets and verify the command can export successfully when the output directory name contains those characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100