The problem is you're not running any commands at all in the new shells, you're just starting them and then independently doing "ipconfig" in your current session. To do what you want you need to pass the commands as arguments to the new PowerShell processes.
$i=1
for(; $i -le 2; $i++)
{
Start-Process powershell.exe -ArgumentList '-NoExit','-Command ipconfig'
}
The -NoExit
part is necessary if you want the PowerShell windows to stay open, without it they'll close after running ipconfig.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…