2013-03-27 52 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