Skip to content
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

Debugging psm1 file #152

Closed
rroman81 opened this issue Apr 21, 2016 · 2 comments
Closed

Debugging psm1 file #152

rroman81 opened this issue Apr 21, 2016 · 2 comments

Comments

@rroman81
Copy link

I am having an issue where i am attempting to debug a psm1 module script. When I launch the debugger with standard Powershell launch.json settings, I get an error "Cannot run a document in the middle of a pipeline: C:\samplemodule.psm1."
Any specific way i can invoke the "import-module .\samplemodule" somehow?

@rkeithhill
Copy link
Contributor

You can create a debug.ps1 file that imports the module and runs exported commands. Or you can create a Pester test (SampleModule.Tests.ps1) file that imports the module and tests the commands in that file. You can than run the debug.ps1 or Pester test file under the debugger.

@rroman81
Copy link
Author

Gotcha. Thank you.

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

No branches or pull requests

2 participants