Skip to content

Escape spaces in OutputFilePath before passing to Export-PSGraph - #53

Closed
claw0ry wants to merge 1 commit into
PrateekKumarSingh:masterfrom
claw0ry:fix-44
Closed

Escape spaces in OutputFilePath before passing to Export-PSGraph#53
claw0ry wants to merge 1 commit into
PrateekKumarSingh:masterfrom
claw0ry:fix-44

Conversation

@claw0ry

@claw0ry claw0ry commented May 31, 2021

Copy link
Copy Markdown
Contributor

This PR fixes an issue where an error is thrown when you use Export-AzViz with a filepath that contains spaces and the -Show argument is passed.

This error occurs because Export-PSGraph, when -Show is $true, will use Invoke-Expression to try to open the file in the systems default application. Invoke-Expression does not support spaces.

@claw0ry

claw0ry commented May 31, 2021

Copy link
Copy Markdown
Contributor Author

This was clearly not tested enough by me. PSGraph includes the backticks in filename and cannot find folders since its treating the backticks literally. Essentially the problem is with PSGraph not supporting spaces in filepaths.

There is a PR open in the PSGraph repository (KevinMarquette/PSGraph#102) for replacing Invoke-Expression with Invoke-Item which does support spaces in filepaths. Better wait for PSGraph to update.

@claw0ry claw0ry closed this May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant