first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

PowerShell 1.0: Two Ways to Run Multiple External Processes with System.Diagnostics.Process

#1: with an instance of System.Diagnostics.Process: $process = New-Object System.Diagnostics.Process; $process.StartInfo.Arguments = "/K cd %ProgramFiles% && dir/w | more"; $process.StartInfo.FileName = "cmd"; $process.Start(); #Returns $true

#2: with static System.Diagnostics.Process: $arguments = "/K cd %ProgramFiles% && dir/w | more"; [System.Diagnostics.Process]::Start("cmd", $arguments).WaitForExit();

#Other alternatives may be possible with Invoke-Expression #or the Call Operator, &

mod date: 2009-08-01T02:15:34.000Z