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: PowerShell Studio 2022 (64 Bit)
Build: v5.8.213
OS: Windows 10 Pro (64 Bit)
Version: v10.0.19044.0PowerShell
*** Please add details and screenshots as needed below. ***
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Break points set inside a file that is dot sourced into an application are not honored when run in the debugger.
Break points set in the main form are honored.
Is this a bug or do I not understand the limitations of the debugger?
I've attached a sample test project.
-James
Dot Sourcing and Debug Break Points
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.
-
- Posts: 7
- Last visit: Tue Feb 06, 2024 4:09 am
Dot Sourcing and Debug Break Points
- Attachments
-
- Test.zip
- Test Project
- (23.16 KiB) Downloaded 160 times
Re: Dot Sourcing and Debug Break Points
Can you please answer the following:
Do you see all breakpoints listed in the Tools Output panel when you start debugging?
Is the file apart of the project?
Are you using V5 or V7? If you are using PowerShell 7, what version?
Do you see all breakpoints listed in the Tools Output panel when you start debugging?
Is the file apart of the project?
Are you using V5 or V7? If you are using PowerShell 7, what version?
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 7
- Last visit: Tue Feb 06, 2024 4:09 am
Re: Dot Sourcing and Debug Break Points
I set two break points. One in the main form and the other in the include file.
I am using powershell version 5.
Two break points are set in the Tools Output.
See the attached images.
Thanks for the quick followup.
-James
I am using powershell version 5.
Two break points are set in the Tools Output.
See the attached images.
Thanks for the quick followup.
-James
- Attachments
-
- Tools Output.png (27.33 KiB) Viewed 8325 times
-
- PSVersion.png (15.41 KiB) Viewed 8325 times
Re: Dot Sourcing and Debug Break Points
You don't need to dot source the file since you have it included in the project. If you change the Shared property of your MoreBirds.ps1 file to true, it should work as expected.
I believe it's getting confused as you have the file included in the project along with the dot sourcing.
For more information on project file settings, the following article may be helpful:
https://www.sapien.com/blog/2022/03/15/ ... roduction/
I believe it's getting confused as you have the file included in the project along with the dot sourcing.
For more information on project file settings, the following article may be helpful:
https://www.sapien.com/blog/2022/03/15/ ... roduction/
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 7
- Last visit: Tue Feb 06, 2024 4:09 am
Re: Dot Sourcing and Debug Break Points
Thank you for the project file settings documentation.
I commented out the dot sourced script.
I enabled the "Shared" property and the debugger is working as expected.
Thanks for your help with this.
-James
I commented out the dot sourced script.
I enabled the "Shared" property and the debugger is working as expected.
Thanks for your help with this.
-James