Batch File Calls Powershell

jstevens
GoldLounger
Posts: 2614
Joined: 26 Jan 2010, 16:31
Location: Southern California

Batch File Calls Powershell

Post by jstevens »

I have a batch file that triggers a number of Powershell commands. The process works just fine however with each Powershell command a blue window (related to Powershell) pops up. I have tried to start it minimized but that doesn't work. I can start the batch file minimized so why not Powershell?

Batch File contents:
cmd /c start /min "" Powershell.exe -WindowStyle Hidden -executionpolicy remotesigned -File Z:\myScript01.ps1
cmd /c start /min "" Powershell.exe -WindowStyle Hidden -executionpolicy remotesigned -File Z:\myScript02.ps1
cmd /c start /min "" Powershell.exe -WindowStyle Hidden -executionpolicy remotesigned -File Z:\myScript03.ps1

Any suggestions are appreciated.
Regards,
John

JoeP
SilverLounger
Posts: 2031
Joined: 25 Jan 2010, 02:12

Re: Batch File Calls Powershell

Post by JoeP »

Try pwsh.exe.
Joe

jstevens
GoldLounger
Posts: 2614
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Batch File Calls Powershell

Post by jstevens »

JoeP,

Thank you for the suggestion as I was able to resolve the window pop up with pwsh.exe.
Regards,
John