I am trying to install a software using powershell in silent mode. But here the requirement is I need to install this in D drive.By default its going there in C drive.
Below is the script which I am running.
Start-Process -FilePath "D:\setup.exe" -ArgumentList "/s",/v"/qn INSTALLDIR=\"D:\Programs\" -WaitStart-Process -FilePath "D:\setup_x64_16.2.0.exe" -ArgumentList "/s",/v"/qn INSTALLDIR=\"D:\Programs\" -Wait Start-Process -FilePath "D\ccsetup.exe" -ArgumentList "/s",/v"/qn INSTALLDIR=\"D:\Programs\"
When I run this script getting error like "A positional parameter cannot be passed an argument". How to solve this error and please provide me some inputs to install into D drive.
You have syntax errors in this post. Hence the errors. If you open you code in the PowerShell ISE or VSCode you'll see the they report syntax errors, via the color coding. You have way to many quotes after the argument parameter.
"A positional parameter cannot be passed an argument".
Your argument string has way to many quotes, hence the position error, related to the syntax error color coding shown in the editors. Take a look at these articles on how to execute external commands via PowerShell
Personally, I wrote a function that I keep in my profile that allows me to call these external .exe vs having to type the strings each time. You can do that as I did from the above information linked to.
PowerShell does not/cannot control where software gets installed, the installer of the vendor does this.