0

We have a program running on about 400 PCs (All W7). This program is called Wisa.

We receive regular updates for this program, named something like wisa_update1.0.exe, wisa_update1.1.exe, wisa_update2.0.exe, etc. The users can not do the update themself due to account restrictions.

We manage to do the update once and distribute it with a copy-item to all PCs. Then with Enter-PSSession I can go to each PC and update the program with the following command:

wisa_update3.0 /verysilent

(with the argument /verysilent no questions are asked)

This is already a major gain in time, but I want to do the update more automatically.

I have a file "pc.txt" with all 400 PCs in it. I use this file already for the Copy-Item via Get-Content. Now I want to use this file to do the updates with the above command, but I can't find a good way to use a remote executable with a parameter in PowerShell.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328

2 Answers2

0

What you want to do is load get-content -Path $PClist and then run your script actions in a foreach. You'll want to adapt this example to your own script:

$PClist = 'c:\pc.txt'

$aComputers = Get-Content -Path $PClist

foreach ($Computer in $aComputers)
{ 
code actions to perform 
}
Colyn1337
  • 1,655
  • 2
  • 18
  • 27
  • Thx for the reply. But i think i did not well explained the question. It's that, were you wrote 'code actions to perform' that i miss. How to perform the command: e:\wisa_update3.0 /verysilent This command is on every pc and i want to start it from a management station. – user2181342 Oct 17 '13 at 20:37
  • @user2181342 In that section is where you create your `PSSession` and then `Enter-PSSession` and finally, execute your update. – Colyn1337 Oct 17 '13 at 21:00
0

Also you can use multithreading and get it over with fraction of time (provided you have a good machine). The below mentioned link explains how to do it well.

http://www.get-blog.com/?p=22

phani
  • 1