r/PowerShell • • 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" -PassThrough
Start-Process C:\\Path\\to\\file.exe --install
Start-Process C:\\Path\\to\\file.exe /S
C:\\Path\\to\\file.exe /S
C:\\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.

1 Upvotes

14 comments sorted by

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 ?

-2

u/exzow Jul 25 '24

The biggest obstacle is finding time where we’re both available for me to remote in and manually do this. Users dont have admin and need me to remote in every time there’s a security update and on every device. If I can do it via Powershell, I can save the users a lot of time and streamline the process.

Is there a command I can run against the installer to find the information I’m looking for? There’s no readme in the download. It’s literally just the security update.

3

u/BlackV Jul 26 '24 edited Jul 26 '24

Is there a command I can run against the installer to find the information I’m looking for?

again 100% dependent on the installer, talk to the softwre company see what they say

The biggest obstacle is finding time where we’re both available for me to remote in and manually do this.

I guess so, but, just schedule a time in a few days (its Friday for me) find the free/busy time in their calendar and book it, if youre just waiting on them to confirm a time it'll never happen

6

u/Sillygirl2520 Jul 26 '24

Run the exe and use /? and see what are options you can use.

1

u/exzow Jul 26 '24

Thank you for this. I’ll try it first thing. : )

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/