Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Install .msi on multiple remote machines

$
0
0

Hi, guys. I am working on a script to install a locally produced .msi on a number of workstations remotely. I have the .msi copied to the C:\Temp directory on all machines. Below is the code that I was trying to use but things just are working out. I'd really appreciate any advice on this.

$blades = Get-Content 'C:\Temp\computers.txt'

foreach ($blade in $blades)
{
    Invoke-Command -ComputerName $blade -Verbose -ScriptBlock {msiexec.exe /i C:\Temp\PDS-M.msi /quiet TARGETDIR=%SYSTEMDRIVE% ROOTDRIVE=%SYSTEMDRIVE% ADDLOCAL=ALL ALLUSERS=TRUE}
}


Viewing all articles
Browse latest Browse all 6937

Trending Articles