powershell脚本中的位置参数错误
Positional Parameter error in powershell script
我试图通过 PowerShell install/update EPO 代理,但出现以下错误。
我是 PowerShell 的新手,所以我看不出是什么原因造成的。
下面是我用来更新代理的脚本:
Start-Process -FilePath $scriptpath "\INAEPO01_Framepkg.exe" "/FORCEINSTALL" "/INSTALL=AGENT" -Wait
错误:
Positional parameter cannot be found that accepts argument
/FORCEINSTALL.
试试看,即在参数之间添加逗号,使它们形成一个数组
Start-Process -FilePath $scriptpath "\INAEPO01_Framepkg.exe","/FORCEINSTALL", "/INSTALL=AGENT" -Wait
或者更明确地说
Start-Process -FilePath $scriptpath -ArgumentList "\INAEPO01_Framepkg.exe", "/FORCEINSTALL", "/INSTALL=AGENT" -Wait
我试图通过 PowerShell install/update EPO 代理,但出现以下错误。 我是 PowerShell 的新手,所以我看不出是什么原因造成的。
下面是我用来更新代理的脚本:
Start-Process -FilePath $scriptpath "\INAEPO01_Framepkg.exe" "/FORCEINSTALL" "/INSTALL=AGENT" -Wait
错误:
Positional parameter cannot be found that accepts argument /FORCEINSTALL.
试试看,即在参数之间添加逗号,使它们形成一个数组
Start-Process -FilePath $scriptpath "\INAEPO01_Framepkg.exe","/FORCEINSTALL", "/INSTALL=AGENT" -Wait
或者更明确地说
Start-Process -FilePath $scriptpath -ArgumentList "\INAEPO01_Framepkg.exe", "/FORCEINSTALL", "/INSTALL=AGENT" -Wait