microsoft / microsoft/powerbi-powershell

Export-PowerBIReport fails with "Wildcard unable to find file" - Workspace has ]'s in name

Open
#318 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.