Positional Parameter error in powershell script

本秂侑毒 提交于 2019-11-26 17:17:51

问题


I was trying to install/update EPO agent through PowerShell, but I am getting below error. I am new to PowerShell so I am not able to see what is causing this.

Below is the script I used to update the agent :

Start-Process -FilePath $scriptpath "\INAEPO01_Framepkg.exe" "/FORCEINSTALL" "/INSTALL=AGENT" -Wait

Error :

Positional parameter cannot be found that accepts argument /FORCEINSTALL.


回答1:


Try it like that, i.e. add commas between the arguments so that they form an array

Start-Process -FilePath $scriptpath "\INAEPO01_Framepkg.exe","/FORCEINSTALL", "/INSTALL=AGENT" -Wait  

or to be more explicit

Start-Process -FilePath $scriptpath -ArgumentList "\INAEPO01_Framepkg.exe", "/FORCEINSTALL", "/INSTALL=AGENT" -Wait


来源:https://stackoverflow.com/questions/39407004/positional-parameter-error-in-powershell-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!