Patch File Microsoft Office 2016 -

Write-Host "Latest available version: $latestVersion" -ForegroundColor Green

$tempDir = "$env:TEMP\Office2016Patch" New-Item -ItemType Directory -Force -Path $tempDir | Out-Null patch file microsoft office 2016

if ([version]$currentVersion -ge [version]$latestVersion) Write-Host "Office 2016 is already up to date." -ForegroundColor Green Remove-Item -Recurse -Force $tempDir -ErrorAction SilentlyContinue exit 0 patch file microsoft office 2016

if (-not (Test-Path $office2016Path)) Write-Host "Office 2016 not found in default locations. Exiting." -ForegroundColor Red exit 1 patch file microsoft office 2016

Write-Host "Installing update (silent mode)..." -ForegroundColor Yellow Start-Process -FilePath $patchFile -ArgumentList "/quiet /norestart" -Wait -NoNewWindow