Posershell script to install *.cab and *.msu

Boopathi S 4,016 Reputation points
2026-06-27T15:40:35.91+00:00

Hello Team,

Share the powershell script to install the below files in remote computeres

SSU-26100.8648-x64.cab

windows11.0-kb5094126-x64.msu

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

Marcin Policht 101K Reputation points MVP Volunteer Moderator
2026-06-27T16:40:47.39+00:00
# List of remote computers
$Computers = @(
    "PC01",
    "PC02",
    "PC03"
)
# Source files location
$SourcePath = "\\FileServer\Updates"
# Update files
$SSUFile = "SSU-26100.8648-x64.cab"
$MSUFile = "windows11.0-kb5094126-x64.msu"
# Remote temp folder
$RemoteTemp = "C$\Temp\Updates"
foreach ($Computer in $Computers) {
    Write-Host "Processing $Computer ..." -ForegroundColor Cyan
    # Create remote folder
    Invoke-Command -ComputerName $Computer -ScriptBlock {
        New-Item -Path "C:\Temp\Updates" -ItemType Directory -Force | Out-Null
    }
    # Copy files
    Copy-Item "$SourcePath\$SSUFile" "\\$Computer\$RemoteTemp\" -Force
    Copy-Item "$SourcePath\$MSUFile" "\\$Computer\$RemoteTemp\" -Force
    # Install updates remotely
    Invoke-Command -ComputerName $Computer -ScriptBlock {
        $SSU = "C:\Temp\Updates\SSU-26100.8648-x64.cab"
        $MSU = "C:\Temp\Updates\windows11.0-kb5094126-x64.msu"
        Write-Host "Installing SSU..."
        dism /Online /Add-Package /PackagePath:$SSU /Quiet /NoRestart
        Write-Host "Installing MSU..."
        wusa.exe $MSU /quiet /norestart
    }
    Write-Host "$Computer completed." -ForegroundColor Green
}

If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

hth

Marcin

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.