Home > Net >  Run powershell with parameters and hide flag
Run powershell with parameters and hide flag

Time:02-11

According to the Error Message

Q: How can I use the hide flag on the run command while still passing params into powershell?

CodePudding user response:

Run, pwsh, -WindowStyle Hidden -Command "Stop-ElgatoKeyLight -Host 192.168.1", Hide

Here you're trying to launch pwsh in a directory -WindowStyle Hidden -Command "Stop-ElgatoKeyLight -Host 192.168.1".
So that's not right, the parameters are Target, WorkingDir, Options, OutputVarPID, as you stated yourself.

So you want
Run, pwsh -Command "Stop-ElgatoKeyLight -Host 192.168.1", , Hide
(or Run, % "pwsh -Command ""Stop-ElgatoKeyLight -Host 192.168.1""", , Hide in modern expression syntax)

  • Related