Thanks Paul for your reply. I’ve pretty much copied your PS tutorial sample you have here. However, I’m not sure where I need to put the $machine variable in order to install the patches from either a local drive or a network share. I can do that part but I’m confused as to where I need to put the $machine variable if I want to install it on each target machine from a text file using the get-contect cmdlet. Here is the script:
# Run the script as administrator
# Possibly change this variable depending
# on where your updates are stored on a network share
$UpdatePath = "\\network sharename\folder"
#List of target machines
$machines = Get-Content -Path \\network sharename\folder\clientlist.txt
# Get list of installed hotfix
Get-HotFix > "$UpdatePath\old_hotfix_list.txt"
# Get a list of all *.msu file updates in the folder
$Updates = Get-ChildItem -Path $UpdatePath | Where-Object {$_.Name -like "*.msu"}
ForEach ($Update in $Updates) {
# Get the full path of the update file
$Updatefilepath = $Update.FullName
#logging
Write-Host "Installing update $Update"
#Install the update
Start-Process -Wait wusa -ArgumentList "/update $Updatefilepath","/quiet","/norestart"
}
# Create new hotfix list
Get-HotFix > "$UpdatePath\new_hotfix_list.txt"