2013-03-27 76 views
0

我要启动多个窗口PowerShell脚本有多个参数启动在多个窗口PowerShell脚本有多个参数

foreach($Instance in $config){ 

    $MaxSamples = $UserInput.MaxSamples 
    $SampleInterval = $UserInput.SampleInterval 
    $instance = $Instance 

     cmd /c start powershell -NoExit -Command {.\sqlcounters.ps1 $instance $SampleInterval $MaxSamples $OutputDirectory $Instance_$MaxSamples_iterations_with_db} 

} 

可以在如何指定多个参数有人sugggest

回答

1

尝试Start-Process cmdlet:

Start-Process powershell -ArgumentList "-NoExit -File c:\test.ps1",$arg1,$arg2,$arg3 
+0

Wohooo Great Shay,Always to the rescue :) – PowerShell 2013-03-28 05:18:24