0

i'm trying to execute new instances of powershell in a loop and pass in parameters. I am able to do this but the additional arguments for setting the window size seems to break things.

Current working without setting the window size

start-process powershell -argumentlist "-noexit -file c:\test\script.ps1 -port 12345"

If I run the below in isolation it works but I can't seem to figure out how to merge this with the above

powershell -argumentlist "-noexit mode con:cols=72 lines=5"

I tried the following but that gave an error:

powershell -argumentlist "-noexit mode con:cols=72 lines=5 -file c:\test\script.ps1 -port 12345"

Invalid parameter - -file

user3436467
  • 1,763
  • 1
  • 22
  • 35
  • Does this answer your question? [How to start powershell with a specific window size from RUN?](https://stackoverflow.com/questions/43296216/how-to-start-powershell-with-a-specific-window-size-from-run) – Theo Mar 02 '20 at 14:42
  • No it doesn't, as I said I can set the window size by itself but the trouble I am having is setting the window size and executing a script with parameters is one command. – user3436467 Mar 02 '20 at 19:21

0 Answers0