r/PowerShell • u/exzow • Jul 25 '24
Question how to install .exe silently from powershell
I'm still pretty new to powershell. I've downloaded an update for Microsoft Visual Studio pro 2017 from the Microsoft Update Catalog.
I've tried:
Start-Process -Wait -FilePath C:\\Path\\to\\file.exe -Argument "/silent" -PassThroughStart-Process C:\\Path\\to\\file.exe --installStart-Process C:\\Path\\to\\file.exe /SC:\\Path\\to\\file.exe /SC:\\Path\\to\\file.exe --silent
And quite a few others. Is there not a way to install this silently from powershell? I'm doing this over the network and want to not interrupt the end user if possible.
6
19
u/g3n3 Jul 25 '24
Every installer is different. You have to read the docs first the installer basically. You probably need the argument list parameter though on all those calls. The wait parameter is good too.
5
u/Skusci Jul 26 '24 edited Jul 26 '24
I looked around with vs update file. Was not able to get anything from the .exe dirrctly however extracting it like a zip file gives you access to vs_setup.exe which seems to accept switches.
After extracting it it should be something like:
Start-Process -Wait -FilePath "C:\vs_setup.exe" -ArgumentList "update --quiet --norestart --installpath ""C:\Program Files\Microsoft Visual Studio\2017\Enterprise"""
vs_setup.exe --help gets you the info on the arguments.
1
u/thebeersgoodnbelgium Jul 26 '24
Try the Install command in kbupdate. Works for many exe (uses Invoke-DscResource in the background)
1
u/singhanonymous Jul 26 '24
You can capture the installation using Repackager or other tools, Create a msi and install silently.
1
u/Arnwalden_fr Jul 26 '24
You can call msiexec command with /quiet option for silence installation.
Similar question on StackOverflow
1
u/AdmRL_ Jul 26 '24
msiexec is for Windows Installer programs (.msi files), it doesn't work with executable installers.
0
u/4thehalibit Jul 26 '24
I tend to vote for "if they want the software they will make time for you". I will also install many things through automation when available.
https://silentinstallhq.com/visual-studio-professional-2017-silent-install-how-to-guide/
7
u/BlackV Jul 25 '24
100% depends on the installer not related to powershell in any way
also 100% dependent on the installer is if it would even work in a remote session, some will not
why dont you want to interrupt the user, do they want the software ?