Can't Debug a Module with Multiple Script Files

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
nate@thep4x.com
Posts: 3
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Wed Aug 21, 2019 4:45 am

Can't Debug a Module with Multiple Script Files

Post 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.

User avatar
brittneyr
Site Admin
Posts: 368
Joined: Thu Jun 01, 2017 7:20 am

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

Post 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/
Brittney Ryn
SAPIEN Technologies, Inc.