Run Powershell Script Visibly

Hello friends,

Is there a way to create a fixlet that calls a PS1 but allows the console output to be visible throughout?

I can get my fixlet to send down the PS1, and even call it successfully, but the console window never appears to let me see anything as it runs. In this case, the fixlet targets servers logged in as admin users, so it is OK that the window would appear.

My latest attempt contains the following, and it does not do as I expected:

override wait
completion=none
hidden=false
runas=agent
wait cmd.exe /C powershell.exe -NoProfile -ExecutionPolicy Bypass "C:\Users\ServerAdminUser\Desktop\Scripts\ScriptToRunVisible.ps1"

Thank you!

This thread will probably help you … Runas Current User Failing

Since the ps1 is executed by the local SYSTEM account, you won’t be able to see any output sent to the console. You could modify your ps1 to write to a logfile and then also have a new Analysis Property read from that log file if you want to view the output within the BigFix ecosystem.

Not ideal and I’ve had the same challenge.

1 Like

This may be what I end up stuck with.

I’m already logging everything that would normally be shown on the console…as you said, not ideal, but it will technically work if that is how it has to be!