1

When attempting to debug a PowerShell script using the option to give VSC an argument, despite the type of data entered be it numeric or string I receive the following error.

"Command PowerShell.SpecifyScriptArgs did not return a string result. Only strings are supported as results for commands used for variable substitution."

The window then gives the option to "Open launch.json" or cancel.

I am running VS Code 1.24.1 with PowerShell extension version 1.7.12. I am running PowerShell v.5.

In the launch.json file I removed the section pertaining to arguments and recreated it using whatever json code generator is built in. No change in results after that.

Any help would be greatly appreciated.

1 Answer 1

1

It looks like the issue you're experiencing is related to this issue where VSCode closed some loophole they had where they were accepting string arrays and now only accept strings. As a result the VSCode Powershell extension broke.

This was fixed in this commit, but I believe they've been delayed in putting together a new release that includes it since the last release was 1.7.0 in April. It should be addressed in the next official release. Btw that 1.7.12 doesn't seem to correspond to the VSCode PowerShell extension version, since the current release is only 1.7.0. That had me confused for a while.

EDIT: It seems like this was finally shipped in the 1.8.0 update. The latest release is 1.8.1 at the time I'm editing this post and should have resolved this issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.