Skip to main content

Invoke-OfficeScrub

Description

Allows the uninstallation of Microsoft Office products via OffScrub.

Usage

  1. Ensures that the session is elevated; if not, it warns and exits.
  2. Determines what switches you entered and sets up an object with the file download locations.
  3. If no switches are present, it warns and exits.
  4. Loops through all the switches, downloading and executing them.
.\Invoke-OfficeScrub.ps1 -Office03

Uninstalls detected Office 2003 installs.

.\Invoke-OfficeScrub.ps1 -Office03 -Office10 -Office16

Removes all detected instances of Office 2003, 2010, and 2016.

.\Invoke-OfficeScrub.ps1 -All

Removes all installed versions of Office.

Parameters

ParameterAliasRequiredDefaultTypeDescription
Office03FalseSwitchUninstalls Office 2003
Office07FalseSwitchUninstalls Office 2007
Office10FalseSwitchUninstalls Office 2010
Office13FalseSwitchUninstalls Office 2013
Office16FalseSwitchUninstalls Office 2016
OfficeC2RFalseSwitchUninstalls Office Click to Run
AllFalseSwitchUninstalls all above Office versions

Output

  • .\Invoke-OfficeScrub-log.txt
  • .\Invoke-OfficeScrub-error.txt