Start-Process выдает ошибку

Вот код

$tool =  "E:\Experiments\Popup\latest\xperf.exe"
$toolOutput =  "XPerfOutput.log"
$toolError = "XPerfError.log"
$command = "-stop"


$x = Start-Process -FilePath $tool -ArgumentList $command -RedirectStandardOutput $toolOutput -RedirectStandardError $toolError -WindowStyle Hidden -PassThru -Wait  

И вот ошибка:

Start-Process : Parameter set cannot be resolved using the specified named parameters. At E:\Experiments\Popup\asd.ps1:9 char:1
+ Start-Process -FilePath $tool -ArgumentList $command -RedirectStandardOutput $toolOutput RedirectStandardError $toolError -WindowStyle Hidden
-PassThru -Wait
+ ~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.StartProcessCommand

Я хочу запустить процесс в скрытом окне , дождитесь его возврата и получите код ошибки, выход и код выхода.

8
задан R.D 28 December 2010 в 01:34
поделиться