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:
Any specific way i can invoke the "import-module .\samplemodule" somehow?
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.
Gotcha. Thank you.
Most helpful comment
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.