Windows Power shell启动后无法获取java进程详细信息。它适用于“记事本”,但不适用于java。
工作记事本cmd:
PS > $apmax=Start-Process notepad "abc.txt" -PassThru
失败的java:
PS > $apmax=Start-Process java "-jar ApMaxProvMngr-1.0.jar" -PassThru
Start-Process : This command cannot be run completely because the system cannot find all the information
required.
At line:1 char:8
+ $apmax=Start-Process java "-jar ApMaxProvMngr-1.0.jar" -PassThru
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
我在这里错过了一些东西吗?
答案 0 :(得分:0)
分别传递多个参数。
$apmax=Start-Process java -ArgumentList '-jar','ApMaxProvMngr-1.0.jar' -PassThru