# Instal a remote update.exe with a parameter

**URL:** <https://forums.powershell.org/t/instal-a-remote-update-exe-with-a-parameter/1169>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/instal-a-remote-update-exe-with-a-parameter/1169 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/instal-a-remote-update-exe-with-a-parameter/1169/1 "2011-12-31T18:30:00Z")

</div>

by Andre at 2013-03-11 03:43:00

> I’m stil learning powershell but i need a quick solution for a problem.  
>   
> The problem is: How can i execute the e:\update.exe file with the parameter  
> /verysilent on a remote computer.  
>   
> We have a program called Wisa, installed upon nearly 400 pc’s.  
> Nearly every 2 month there’s an update. Until now we do the update via  
> rdp, download the update from a local server and execute it with a  
> parameter /verysilent. As you can imagine this is a lot of work. We’re  
> trying to do a little more automatic. So we have an extra drive on  
> our pc’s (all w7), the e:drive and we can already copy the update via   
> copy-item to all the pc’s.  
> The command we use is:   
> **copy-item \dc01\e$\shares\wisa\updates\CSWisAdmin\_clupd\_4.4.0.0.exe \site-ne-sec-01\e$**  
>   
> On all pc’s now we also have remote powershell enabled.  
> I can **enter-pssession site-ne-sec-01** to connect, no problem.  
> Than i execute the command **e:\cswisadmin\_clupd\_4.4.0.0.exe /verysilent** , no problem  
> and leave the remote pc with **exit-pssession** , no problem.  
> This is already a major time improvement for us.   
> But i want to trigger the update from my management pc.  
> I tried the invoke-command but i’m no able to find the correct syntax.  
>   
> I also tried the invoke-command with the filepath parameter.  
> Loacal scriptname is update.ps1  
> In this script the only line is: e:\cswisadmin\_clupd\_4.4.0.0.exe /verysilent  
>   
> then the invoke command:  
> **Invoke-command -computername site-ne-sec-01 -filepath c]  
> But it doesn’t work.**  
>   
> **Any help is appreciated.**

by DonJ at 2013-03-11 06:17:47

> Invoke command probably isn’t giving the command time to complete. Try starting a session and invoking the command against the session instead of a computer name. And obviously confirm that the executable is already on the remote machine.

by Andre at 2013-03-11 07:45:48

> Thx for the quick response.  
> I’m sure the executable is on the remote machine because manually i can start it via enter-pssession and the computername.  
> I’m new to powershell and have no idee what you mean by ‘invoking the command against a session’.  
> Can you provide me some programming that i can work with to find a solution.  
> thx

by DonJ at 2013-03-11 08:19:18

> $s = new-PSsession -computer WHATEVER  
> Invoke-command -file whatever -session $s

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:58pm UTC](https://forums.powershell.org/t/instal-a-remote-update-exe-with-a-parameter/1169/2 "2024-05-16T20:58:08Z")

</div>

Closed on May 16, 2024, 8:58pm UTC


