Search code examples
powershellwindows-installer

Powershell Throws “Cannot Validate The Argument on Parameter” Error But Still Works?


Fairly simple line in my Powershell script to run an install. The line works- the installer comes up and completed successfully. Yet this error persists.

Start-Process -Wait (msiexec.exe /I “C:\Temp\MBAM 2.5\Installers\x64\MBAMClient.msi”)

The error:

Start-Process : A positional parameter cannot be found that accepts argument ‘C:\Temp\MBAM 2.5\Installers\x64\MBAMClient.msi’
At line:1 char:1

Even though it works it’s important not to have errors in my console not only for obvious reasons but also for approval.


Solution

  • I fixed it by simplifying the command to:

    ‘Start-Process -Wait ‘C:\Temp\MBAM 2.5\Installers\x64\MBAMClient.msi’‘

    That’s all it took. Installs, waits, and no error.