Skip to content

Instantly share code, notes, and snippets.

@win2000b
Created June 27, 2019 09:46
Show Gist options
  • Save win2000b/e71215a1e91b0606f555557ea125865f to your computer and use it in GitHub Desktop.
Save win2000b/e71215a1e91b0606f555557ea125865f to your computer and use it in GitHub Desktop.
Fix Office Install Remotely via PowerShell
$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