I see a few problems, maybe just typos while you were typing up your post.
- You have a space between your dash/hyphen and the Path switch.
- You close your quotes after INSTALLDIR and then try to close again after Autodesk
- Your %programfiles% variable is missing the backslash to separate it from Autodesk
To help with keeping quotes straight, I would suggest a couple of things:
- Use single quotes whenever possible. Single quotes are used for strings that contain nothing that needs to be resolved, where double quotes are called for when they do.
-Path 'Setup.exe' will work because it’s nothing but a string.
But if you include the $dirFiles variable, you’d need double quotes.
-Path "$dirFiles\Setup.exe" because the variable needs to be resolved at runtime.
- Be careful when copying/pasting quotes. You may end up with ‘smart quotes’ that Powershell no likey.
Assuming your syntax is correct regarding what Revit wants for install switches, this looks better:
Execute-Process -Path 'Setup.exe' -Parameters “/t /qb /language en-us /c RLT: INSTALLDIR %programfiles%\Autodesk"
Or, if possible, you could remove the
%programfiles% variable and go with the simpler path,
C:\Program Files and use this:
Execute-Process -Path 'Setup.exe' -Parameters '/t /qb /language en-us /c RLT: INSTALLDIR C:\Program Files\Autodesk'