0

I'm looking for a way to open multiple powershell windows through a script. I tried with the following code, but it doesn't work.

for($1 = 1 ; $i -le 3; $i++)
{
    Start-Process powershell.exe
}

How can I reach this goal?

1 Answer 1

1

Not sure where $1 came from, change it to this:

for($i = 1 ; $i -le 3; $i++)
{
    Start-Process powershell.exe
}

and it'll work.

What's the end goal? Opening up new powershell processes will be slow and isn't usually necessary.

Sign up to request clarification or add additional context in comments.

3 Comments

Hello @PMental thank you for your answer. How can I run your code in a powershell window? If I try, nothing happens. The goal is to run a different command in each window to download video from destreamer. I will ask other questions to get this goal.
How did you run your own code? You can just paste it in the shell, but the best way is obviously to put it in a script and save it to a .ps1 file.
Open ISE, and paste it in the "Scripting Pane" (the white area), and run it by clicking the "play" icon. No need to continue to copy and paste

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.