Cannot step through PowerShell script in debug

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.
This topic is 7 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
robwm1
Posts: 90
Last visit: Tue Jul 11, 2017 11:54 am

Cannot step through PowerShell script in debug

Post by robwm1 »

Product, version and build: 7.2.96.0
(*** Please do not write "latest" as a version, specify a version number ***)
32 or 64 bit version of product: 64-bit
Operating system: Windows 10 Enterprise
32 or 64 bit OS: 64-bit

Hi,

I need to step through my PowerShell script to observe the execution path that is taken. I'm choosing Debug Elevated from the Debug Group. After doing this, it executes the entire script without stepping. Is this expected behavior when coding in PowerShell? I know this works with vbscript.

Thanks,
Rob
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Cannot step through PowerShell script in debug

Post by Alexander Riedel »

Did you set a breakpoint?
VBScript stops at the first instruction if there is no breakpoint.
Powershell does not do that. You need to set a breakpoint yourself.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
robwm1
Posts: 90
Last visit: Tue Jul 11, 2017 11:54 am

Re: Cannot step through PowerShell script in debug

Post by robwm1 »

Ok, that makes sense. It's working following your advice.

Carnac the Magnificent is amazing!
This topic is 7 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.