PDA

View Full Version : How do I see PowerShell script progress?


mevans
12-20-2019, 06:42 PM
I'm using a PowerShell action. It works just fine with Visual Build and I can send data to it and get it back into VBP. My problem with this particular script is that it may run for a very long time (a few minutes to over a half hour). If I run it in PowerShell, I can turn on verbose and see some output so I know it's alive. When I run it from VBP, I don't get any feedback. It's reassuring to know something is happening.

How can I see the output while it's running in VBP?

This particular script starts in a specific folder and has PowerShell script in VBP (it's not calling a separate file). Inside the script, I dot include some external PowerShell files that are needed for the script to run in VBP.

I've tried Options / Show application window. That puts up a window, but I don't see any output.

kinook
12-20-2019, 09:59 PM
I'm seeing the output from a long-running PowerShell script as it executes. See attached.

mevans
12-23-2019, 07:16 PM
Sorry for the bother. I have these two lines in my script:

#$VerbosePreference = "continue"
#$VerbosePreference = "SilentlyContinue"

I had been debugging some things and switched it to SilentlyContinue for a bit and didn't catch that switch on a commit :(

I had intended to commit the script with "continue" enabled so that I'd see the output in Visual Build. Once I set it to "continue", the VERBOSE output showed up just fine in the Visual Build output window and in the log file. All is well :)