Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Can I run a Powershell Command and have it show me the Powershell Window so I can monitor it?


I use Cluster Aware Updating to patch a bunch of clusters in our environment.  I normally open the CAU program, pick the cluster, go through the screens, and start it going.  I can then monitor the progress in the CAU screen so I can see how it's going, how far along it is, etc.

The CAU program just runs a Powershell command to kick off the updating, so I thought maybe I could automate this with PDQ.  The command that's generated by the CAU program is simply:

Invoke-CauRun -ClusterName Cluster1 -Force -CauPluginName Microsoft.WindowsUpdatePlugin -CauPluginArguments @{ 'IncludeRecommendedUpdates' = 'False' } -MaxRetriesPerNode 3 -EnableFirewallRules;

I can create a package in PDQ Deploy to run this.  However, I can't seem to find a way to have it actually open up the Powershell window as it runs so I can follow along and see how it's going.  It'd also be OK if it would open the actual CAU program so I could monitor it that way.

I tried having the command run as Deploy User (Interactive), but that didn't seem to do anything.  I tried running it as Logged In User, but that also didn't do anything.

Does anyone know if there's a way I can have PDQ run the above PowerShell command in such a way that I can monitor the progress of the machines updating?




Date Votes
  • Hello,

    This is the same message that I sent to you previously, but wanted to share it here in case it's helpful to others who stop by:

    If you wanted to have a deployment pop up something, you could look into using a PowerShell step running as Deploy User (Interactive). You could then use Start-Process to open a new PowerShell window and run a script. Start-Process PowerShell.exe -ArgumentList '-file c:\temp\testfile.ps1'
    Rather than doing bringing up an external PowerShell window, I recommend checking the output log for the package to see if there is valuable information there.

  • My specific example was for Cluster Aware Updating.  I found a work around by having a two step deployment

    1. CMD - start clusterupdateui.exe <clustername>
    2. PS - Invoke-CauRun -ClusterName blahblah see above

    The first step opens the CAU GUI so I can monitor what's going on.  The second step kicks off the actual update.  By adding the "start" word in front of the exe in step 1, it fires off the command and then immediately continues to the second step which does exactly what I need.

    I tried using the Interactive thing previous but tried it with just a one-line command and couldn't make it work.  Once I found the solution I'm using, I don't think I ever went back and tried it with the start-process stuff since I'd prefer to have the actual GUI open up anyway over seeing the PS window.