Skip to content

Instantly share code, notes, and snippets.

@wise-io
Last active February 13, 2022 21:08
Show Gist options
  • Save wise-io/94aab9d0936908cd0e933a08351e818c to your computer and use it in GitHub Desktop.
Save wise-io/94aab9d0936908cd0e933a08351e818c to your computer and use it in GitHub Desktop.
PowerShell Script to Initiate Microsoft Office Updates
# Initiates Microsoft Office updates
$Path = 'C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe'
$Arguments = '/update user'
# Get the process name
$ProcessName = [System.IO.Path]::GetFileNameWithoutExtension($Path)
# Check if Microsoft Office updates are running
$Running = Get-Process $ProcessName -ErrorAction SilentlyContinue
# If not running, start Microsoft Office updates
if (!$Running) {
Write-Output 'Starting Microsoft Office update process...'
Start-Process -FilePath $Path -ArgumentList $Arguments
}
else {
Write-Output 'The Microsoft Office update process is currently running.'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment