-
Notifications
You must be signed in to change notification settings - Fork 511
Problem debugging script with arguments if path to script contains spaces #1526
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
Thanks for the very detailed issue! It's very helpful. My guess is that we're probably spliting the args string by " " and that's what's causing this. We'll investigate. |
I reread this... question @tms320. Are you debugging with the "PowerShell Interactive Session" debug config? |
this might be us not properly escaping paths |
I tried two debug configurations (defined in launch.json):
Second: PowerShell Launch Current File w/Args Prompt
|
The first one works and the second one doesn't. Is that correct? |
No. Both configurations work incorrectly. |
Thanks for the info. I think I have an idea of a fix but I need to do some proper testing. |
@tms320 I believe I have a fix for this. Until then, you might be able to work around the issue by putting your arguments in single quotes inside the double quotes (which is silly, but shouldn't be needed later) |
My powershell script "test.ps1" is located in "C:\Program Files (x86)\SomeFolder" folder.
If I start debug this script (F5 key) without command line arguments then everything works fine.
But if I start debug with command line argument (for example "param1") then I get error in powershell console (the message is in russian, sorry:)):
The translation of message to english:
x86: The name "x86" is not recognized as the name of the cmdlet, function, script file, or executable. Check the spelling of the name, as well as the presence and correctness of the path, and then try again
ku.
string: 1 character: 23
PS: I manually set command line argument via 'launch.json' file, for configuration 'PowerShell Launch Current File' as follows:
I also tried configuration 'PowerShell Launch Current File w/Args Prompt' - the problem remains.
If I move my script in folder without spaces in it's path (for example, "C:\Tmp\SomeFolder") then the problem disappears.
The text was updated successfully, but these errors were encountered: