msiexec /i "example.msi" /q UserName="my username" password="my password"
The above command is executed perfectly in the command line but I need to execute in the powershell in a single line. So any one please suggest. I am new to the powershell.
I have tried below one:
Start-Process -FilePath msiexec -ArgumentList / /i, example.msi, "UserName='my username'","password='my password" -Wait
but it shows some issue:
Start-Process : A positional parameter cannot be found that accepts argument 'System.Object[]'.
At line:1 char:1
+ Start-Process -FilePath msiexec -ArgumentList / /i, "'example.msi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand