Created
June 27, 2019 09:46
-
-
Save win2000b/e71215a1e91b0606f555557ea125865f to your computer and use it in GitHub Desktop.
Fix Office Install Remotely via PowerShell
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
$command64 = @' | |
cmd.exe /C "C:\Program Files\Microsoft Office 15\ClientX64\OfficeClickToRun.exe" scenario=Repair platform=x64 culture=en-us RepairType=QuickRepair forceappshutdown=True DisplayLevel=False | |
'@ | |
$command86 = @' | |
cmd.exe /C "C:\Program Files\Microsoft Office 15\ClientX86\OfficeClickToRun.exe" scenario=Repair platform=x86 culture=en-us RepairType=QuickRepair forceappshutdown=True DisplayLevel=False | |
'@ | |
if(Test-Path -Path "C:\Program Files\Microsoft Office 15\ClientX64\OfficeClickToRun.exe"){ | |
Invoke-Expression -Command:$command64 | |
} elseif(Test-PAth -Path "C:\Program Files\Microsoft Office 15\ClientX32\OfficeClickToRun.exe"){ | |
Invoke-Expression -Command:$command86 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment