Removes Microsoft Graph, Entra, Azure (Az), and legacy AzureRM modules completely — handling dependency chains, retries, and leftover directories that Uninstall-Module leaves behind.
| Command | What it removes |
|---|---|
Uninstall-Graph | Microsoft.Graph.* modules |
Uninstall-Graph -Entra | Microsoft.Entra.* modules only |
Uninstall-Graph -All | Microsoft.Graph.* + Microsoft.Entra.* modules |
Uninstall-Az | Az.* modules + legacy AzureRM.* modules |
Uninstall-All | All of the above + AIPService, MSIdentityTools, AzureAD, ExchangeOnlineManagement, MicrosoftTeams, and more |
All commands support -SkipAdminCheck to run without elevated privileges on Windows.
Install-Module Uninstall-GraphRemoves all Microsoft.Graph.* modules. Add -Entra for Entra modules, or -All for both.
Uninstall-GraphUninstall-Graph -EntraUninstall-Graph -AllUninstall-Graph -SkipAdminCheckRemoves all Az.* modules and automatically cleans up legacy AzureRM.* modules if present.
Uninstall-AzUninstall-Az -SkipAdminCheckRemoves all Microsoft cloud PowerShell modules in one go — Graph, Entra, Az, AzureRM, plus additional modules like ExchangeOnlineManagement, MicrosoftTeams, and AzureAD.
Uninstall-AllUninstall-All -SkipAdminCheckMicrosoft Graph, Azure PowerShell (Az), and legacy AzureRM all ship with dozens of interdependent sub-modules. Running Uninstall-Module fails partway through because of dependency ordering, leaves module directories on disk, and often requires multiple manual passes.
This module handles the complexity by:
Az.Accounts and AzureRM.Profile are removed last.Uninstall-AzureRm from Az.Accounts before falling back to manual cleanup.I'm a Product Manager at Microsoft. Here are some other things I've built for the community.