Last active
February 13, 2022 21:08
-
-
Save wise-io/94aab9d0936908cd0e933a08351e818c to your computer and use it in GitHub Desktop.
PowerShell Script to Initiate Microsoft Office Updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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