使用多个参数在多个窗口中启动powershell脚本
我想在多个窗口中使用多个参数启动powershell脚本使用多个参数在多个窗口中启动powershell脚本,powershell,Powershell,我想在多个窗口中使用多个参数启动powershell脚本 foreach($Instance in $config){ $MaxSamples = $UserInput.MaxSamples $SampleInterval = $UserInput.SampleInterval $instance = $Instance cmd /c start powershell -NoExit -Command {.\sqlcounters.ps1 $insta
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}
}
是否有人建议如何指定多个参数请尝试
启动流程
cmdlet:
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}
}
Start-Process powershell -ArgumentList "-NoExit -File c:\test.ps1",$arg1,$arg2,$arg3
Wohooo伟大的Shay,总是在营救:)