Install-MSTeams
Description
Installs Microsoft Teams (New) utilizing Microsoft's Teamsbootstrapper.exe and optionally uninstalls and deprovisions the existing Microsoft Teams installation before reinstalling.
Requirements
- PowerShell v5
Usage
-
Sets up the environment by downloading necessary repository packages.
-
Downloads the Teamsbootstrapper.exe from the official Microsoft download URL.
-
If the
-Upgrade
parameter is specified: a. Checks if Microsoft Teams is currently installed using theIsAppInstalled
function. b. If Microsoft Teams is installed, uninstalls the AppxPackage for all users. c. Deprovisions Microsoft Teams using the Teamsbootstrapper.exe with the-x
flag. d. Deletes the registry keyHKLM:\SOFTWARE\WOW6432Node\Microsoft\Office\Teams
if it exists, which resolves the common error code (0x80004004) where themaglevInstallationSource
regkey has been left behind. e. Verifies that Microsoft Teams is not installed as a ProvisionedAppPackage or AppxPackage for any user after the uninstallation process. -
Attempts to install Microsoft Teams using the Teamsbootstrapper.exe with the
-p
flag. -
Parses the JSON result from the Teamsbootstrapper.exe command to determine the installation success.
-
Logs the installation result and exits with the appropriate exit code.
Installs Microsoft Teams (New) using the Teamsbootstrapper.exe:
.\Install-MSTeams.ps1
Uninstalls and deprovisions the existing Microsoft Teams installation before reinstalling:
.\Install-MSTeams.ps1 -Upgrade
Parameters
Parameter | Alias | Required | Default | Type | Description |
---|---|---|---|---|---|
Upgrade | False | Switch | Will uninstall and deprovision the existing Microsoft Teams installation before reinstalling via Teamsbootstrapper.exe. Only run this command if there is an issue preventing Teamsbootstrapper.exe from installing. |
Output
.\Install-MSTeams-log.txt
.\Install-MSTeams-error.txt