-
Notifications
You must be signed in to change notification settings - Fork 510
Running debugger against module manifest (psd1) file results in confusing error message #503
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
You can already set up multiple launch configurations that launch specific file paths, but launching .psd1 files isn't currently supported. I'll either add support for it or add an appropriate error message. |
You can set up multiple configurations. In the Debug view, press the |
Also, be sure to check out my Scripting Guys |
And for launching Pester tests - see #487. It can be made to work now but I'm not sure I would rely on it - which is why I didn't add support yet. |
Sounds good, thanks. I'd suggest keeping this open for the purposes of tracking "launching" a .psd1 file. What exactly would that do? I would maybe throw an exception, saying that you can't launch a .psd1, maybe? Not sure I have the best solution, but the current exception certainly isn't immediately helpful. |
Ideally it'd just call Import-Module with that path and drop you into the console. |
On the extension, do we have a chance to inspect the |
Yep, check out this function: If you want to stop execution from happening, skip the |
Should we initially not allow debugging of a |
Hmmm, good point. We can probably figure out whether it's a module manifest file, but not necessarily worth doing right now. |
…n-invalid-file-type Fix #503 cancel debug on invalid file types.
Why is this still not supported? |
If you hit F5 to invoke the debugger, and currently have a PowerShell module manifest file open, a confusing exception is thrown, and captured in the Visual Studio Code Debug Console.
It'd be great to be able to set up multiple launch configurations, similar to how NPM works, so that hitting F5 isn't dependent on having the right file selected. For example, you might set up a launch configuration to invoke unit tests, or a separate one to publish the module to the PowerShell Gallery, etc. etc.
Cheers,
Trevor Sullivan
Docker Captain
Microsoft MVP: Cloud & Data Center Management
https://trevorsullivan.net
https://twitter.com/pcgeek86
The text was updated successfully, but these errors were encountered: