Page 1 of 1

Can't Debug a Module with Multiple Script Files

Posted: Thu Jan 30, 2020 4:52 am
by nate@thep4x.com
To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build:5.7.172
32 or 64 bit version of product:64 bit
Operating system:Windows 10 Pro 1903
32 or 64 bit OS:64 bit

*** Please add details and screenshots as needed below. ***

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

I'm trying to debug a module with multiple script files. I have breakpoints set in the script files but selecting "Debug with Multiple Files" doesn't seem to do anything. It will not debug anything outside of the starter script or .psm file.

Re: Can't Debug a Module with Multiple Script Files

Posted: Thu Jan 30, 2020 8:08 am
by brittneyr
As I'm not quite sure how you have your scripts set up, I have tested the functionality and have found no issues.

When debugging with multiple files make sure you run the file(s) inside of your scripts like the following:

Script Example.ps1:
  1. Get-Date
  2.  
  3. ./Example2.ps1
  4.  
  5. Write-Output "Finished"
Script Example2.ps1:
  1. Get-Process
  2.  
  3. Write-Output "Finished Second Script"

Even though this article is about PrimalScript, the same applies to PowerShell Studio:
https://www.sapien.com/blog/2012/10/11/ ... ript-2012/