-
Notifications
You must be signed in to change notification settings - Fork 511
Unable to debug scripts in folder with ampersand in title #1400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It sounds like you're not quoting the path properly? That error is from powershell trying to parse an ampersand where it doesn't belong. Currently it's only supported in two locations: Redirection and as the call operator. |
@Lowestkillcount Can you give an example of the path that isn't working? Also, have you tried this in PowerShell without VSCode? If it reproduces in PowerShell without VSCode, it would probably be a PowerShell issue (or could be by design). |
Interestingly enough - i've just reopened the same file i was working on and this doesn't happen anymore.... however this is on a different PC so maybe something in the other environment.. The issue was when working on a file in path: Using the Debug\Start Debugging option in the menu would result in the console throwing an error like below. The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string. As when you do this the debugger runs the whole script path against the console like this PS C:\Users\LKC\Onedrive - S&M Company Pty Ltd> c:\Users\LKC\Onedrive - S&M Company Pty Ltd \Script.ps1 I'll double check on my work laptop on Monday if it still occurs there, it may be some obscure setting in my profile causing issues. |
I'm having trouble reproducing this currently. @DanrwAU, are you still seeing this issue? |
@DanrwAU are you still having this problem in 1.9.0? I fixed a URI issue that would explain this bug and curious to see if it persists. |
Sorry missed the last update 😄 I haven't had it happen recently, i may have debugged a few times but generally i avoid using VSCode to debug as all my scripts live in a path with an ampersand. I'll test it out and let you know |
No worries — totally understand |
Still happening. |
Bugger. I think we've just identified where the problem is at least, so a fix is within reach. |
I have a fix for this in the PR shown above, so hopefully we can build a new extension pre-release artefact within the week for you to test @DanrwAU |
Just confirming this seems to be fixed in the latest version of the Powershell extension great work👍 |
Issue Description
I am experiencing a problem with running debug on script residing in a folder path containing an ampersand.
When running these i get the following error:
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.
This works fine in ISE.
Unfortunately as this is a hardcoded onedrive path i can't easily modify this.
Attached Logs
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: