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.

4

2 に答える 2

0

あなたがしたいことはget-content -Path $PClist、スクリプトアクションをロードしてから実行することforeachです. この例を独自のスクリプトに適合させたいと思うでしょう:

$PClist = 'c:\pc.txt'

$aComputers = Get-Content -Path $PClist

foreach ($Computer in $aComputers)
{ 
code actions to perform 
}
于 2013-10-15T16:44:29.420 に答える