I’m fairly new to Powershell and have written some pretty large scripts ie a script that calls others scripts which have functions nested in other functions. When I launch this script I sometimes get errors that I don’t know where they came from. Is there an easy way to see where this script terminated so I can troubleshoot the error?
You can use
Set-PsDebug to get PowerShell to output almost every line it runs:
Set-PSDebug -Trace 1;
Only downside is you’ll probably end up with a lot of output to wade through…