Outfile Question


I’m currently downloading and installing the vlc player silently:

When i run the following, all is fine.

Invoke-WebRequest -Uri "https://www.vlcwebsite.." -OutFile "c:\support\vlc-3.0.3-win64.exe"
& "c:\support\vlc*.exe" /L=1031 /S

I want to change the outfile to read c:\support\vlc.exe or something similar because the version of the vlc player will change.

If I run the following, the file gets downloaded but nothing happens with the install.

Invoke-WebRequest -Uri "https://www.vlcwebsite.." -OutFile "c:\support\vlc.exe"
& "c:\support\vlc.exe" /L=1031 /S

Does anyone know what would be the best way to approach this, is the problem the outfile?


This doesn’t work?

c:\support\vlc.exe /L=1031 /S

Unfortunately not. If I run the c:\support\vlc.exe /L=1031 without the /S switch, it pops up the installer. If I run this, c:\support\vlc.exe /L=1031 /S, nothing seems to happen.

Is there a way to be non-specific about the outfile, could I use a -like switch?
I just don’t know how to deal with the change in the vlc.exe name from the website.

Thanks for the support.

Try using Start-Process instead and pass your switches as part of the ArgumentList:

Start-Process -FilePath "C:\Support\vlc.exe" -ArgumentList '/L=1031','/S' -NoNewWindow

Hi Joel,

Thanks for that, that helped me a lot.