Page 1 of 1

Cannot step through PowerShell script in debug

Posted: Thu Nov 17, 2016 3:16 pm
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

Re: Cannot step through PowerShell script in debug

Posted: Thu Nov 17, 2016 3:20 pm
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.

Re: Cannot step through PowerShell script in debug

Posted: Thu Nov 17, 2016 3:24 pm
by robwm1
Ok, that makes sense. It's working following your advice.

Carnac the Magnificent is amazing!