Product, version and build: PowerShell Studio 2016 [REMOVED BY MODERATOR]
32 or 64 bit version of product: 64
Operating system: Windows 7
32 or 64 bit OS: 64
I am trying to debug multiple files without success.
I have:
- A main file, with parameters and no functions
- 2 accessory files, with multiple functions (each function has parameters).
The main file dot sources the accessory files at the beginning and calls the functions as needed.
Now, everything works fine and dandy when I debug one file at a time.. as it prompts me for the parameters.
The issue arises if I try to debug all of them together. it never prompts for the parameters and quits the debug immediately.
Any ideas?
UPDATE: I found a way to run the main file in multi-file debug by using the call function in the project startup file Startup.pss:
Call-mainfile_ps1 -param1 "string1" -param2 "string2". So the main file runs and debugs.
The problem is that when it calls the dot sourced functions, it doesn't switch file to let me debug those functions - it just runs them and goes to the next breakpoint in the main file.
Of course the accessory files all have their breakpoints.
Debug with multiple files not working
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.
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.
Re: Debug with multiple files not working
For your own protection, please do not post your subscription number on the forums.
I'm assuming you are working in a project?
If you are working with a project and are dot sourcing ps1 files, make sure you mark the file's Build setting to Content.
1. Select the file in the project panel:
2. Then set the Build property in the Property Panel:
The file will no longer have a Call- function associated with the file and it will remain as is. Then you can debug the project using the normal Debug command instead of Debug with Multiple files command.
David
I'm assuming you are working in a project?
If you are working with a project and are dot sourcing ps1 files, make sure you mark the file's Build setting to Content.
1. Select the file in the project panel:
2. Then set the Build property in the Property Panel:
The file will no longer have a Call- function associated with the file and it will remain as is. Then you can debug the project using the normal Debug command instead of Debug with Multiple files command.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Debug with multiple files not working
YES!! YES!!!!
You don't know how much headache this saves me in debugging, as I kep calling functions back and forth between files.
Many thanks.
You don't know how much headache this saves me in debugging, as I kep calling functions back and forth between files.
Many thanks.