@@ -13,9 +13,9 @@ feedback through the [Send-Feedback](/powershell/module/az.accounts/send-feedbac
13
13
encountered a bug, we'd appreciate it if you
14
14
[ file a GitHub issue] ( https://github.com/azure/azure-powershell/issues ) so that it can be fixed.
15
15
16
- ## Uninstall Azure PowerShell from MSI
16
+ ## Uninstall the Az PowerShell module from MSI
17
17
18
- If you installed Azure PowerShell using the MSI package, you must uninstall through the Windows
18
+ If you installed Az PowerShell module using the MSI package, you must uninstall through the Windows
19
19
system rather than PowerShell.
20
20
21
21
| Platform | Instructions |
@@ -27,15 +27,15 @@ Once on this screen, you should see **Azure PowerShell** in the program listing.
27
27
uninstall. If you don't see this program listed, then you installed through PowerShellGet, and
28
28
should follow the next set of instructions.
29
29
30
- ## Uninstall Azure PowerShell from PowerShellGet
30
+ ## Uninstall the Az PowerShell module from PowerShellGet
31
31
32
32
To uninstall the Az modules, you can use the
33
33
[ Uninstall-Module] ( /powershell/module/powershellget/uninstall-module ) cmdlet. However,
34
- ` Uninstall-Module ` only uninstalls one module. To remove Azure PowerShell completely, you must
35
- uninstall each module individually. Uninstallation can be complicated if you have more than one
34
+ ` Uninstall-Module ` only uninstalls one module. To remove the Az PowerShell module completely, you
35
+ must uninstall each module individually. Uninstallation can be complicated if you have more than one
36
36
version of Azure PowerShell installed.
37
37
38
- To check which versions of Azure PowerShell you've installed, run the following command:
38
+ To check which versions of the Az PowerShell module you've installed, run the following command:
39
39
40
40
``` powershell-interactive
41
41
Get-InstalledModule -Name Az -AllVersions
@@ -52,7 +52,7 @@ Version Name Repository Descript
52
52
53
53
The following script queries the PowerShell Gallery to get a list of dependent submodules. Then,
54
54
the script uninstalls the correct version of each submodule. You need to have administrator access
55
- to run this script in a scope other than ** Process** or ** CurrentUser ** .
55
+ to run this script in a scope other than ** Process** or ** Current User ** .
56
56
57
57
``` powershell-interactive
58
58
function Uninstall-AzModule {
@@ -149,7 +149,8 @@ function Uninstall-AzModule {
149
149
```
150
150
151
151
To use this function, copy and paste the code into your PowerShell session. The following example
152
- shows how to run the function to remove an older version of Azure PowerShell.
152
+ shows how to run the function to remove an older version of the Az PowerShell module and its
153
+ submodules.
153
154
154
155
``` powershell-interactive
155
156
Uninstall-AzModule -Name Az -Version 1.8.0
@@ -175,27 +176,26 @@ Az.ApplicationInsights 1.0.0 Uninstalled
175
176
> uninstall _ any_ version of that dependency. This is because there may be other versions of the
176
177
> target module on your system which rely on these dependencies.
177
178
178
- Run the following example for every version of Azure PowerShell that you want to uninstall. For
179
- convenience, the following script uninstalls all versions of Az ** except** for the latest.
179
+ Run the following example for every version of the Az PowerShell module that you want to uninstall.
180
+ For convenience, the following script uninstalls all versions of Az ** except** for the latest.
180
181
181
182
``` powershell-interactive
182
- $Modules = Get-InstalledModule -Name Az -AllVersions |
183
- Sort-Object -Property Version -Descending |
183
+ $Modules = Get-InstalledModule -Name Az -AllVersions |
184
+ Sort-Object -Property Version -Descending |
184
185
Select-Object -Skip 1
185
186
$Modules | ForEach-Object {Uninstall-AzModule -Name $_.Name -Version $_.Version}
186
187
```
187
188
188
189
## Uninstall the AzureRM module
189
190
190
191
If you have the Az module installed on your system and would like to uninstall AzureRM, there are
191
- two options that don't require running the ` Uninstall-AzModule ` script above. Which method you
192
- follow depends on how you installed the AzureRM module. If you're not sure of your original install
193
- method, follow the steps for uninstalling an MSI first.
192
+ two options. Which method you follow depends on how you installed the AzureRM module. If you're not
193
+ sure of your original installation method, follow the steps for uninstalling an MSI first.
194
194
195
- ### Uninstall Azure PowerShell MSI
195
+ ### Uninstall the AzureRM PowerShell module from MSI
196
196
197
- If you installed the Azure PowerShell AzureRM modules using the MSI package, you must uninstall
198
- through the Windows system rather than PowerShell.
197
+ If you installed the AzureRM PowerShell module using the MSI package, you must uninstall through the
198
+ Windows system rather than PowerShell.
199
199
200
200
| Platform | Instructions |
201
201
| ------------------------ | ------------------------------------------------------ |
@@ -206,22 +206,13 @@ Once on this screen, you should see **Azure PowerShell** or **Microsoft Azure Po
206
206
Year** in the program listing. This is the app to uninstall. If you don't see this program listed,
207
207
then you installed through PowerShellGet, and should follow the next set of instructions.
208
208
209
- ### Uninstall from PowerShell
209
+ ### Uninstall the AzureRM PowerShell module from PowerShellGet
210
210
211
211
If you installed AzureRM with PowerShellGet, then you can remove the modules with the
212
212
[ Uninstall-AzureRM] ( /powershell/module/az.accounts/uninstall-azurerm ) cmdlet, available as part of
213
- the ` Az.Accounts ` module. The following example removes _ all_ AzureRM modules from your machine but
213
+ the ` Az.Accounts ` module. The following example removes _ all_ AzureRM modules from your machine. It
214
214
requires administrator privileges.
215
215
216
216
``` powershell-interactive
217
217
Uninstall-AzureRm
218
218
```
219
-
220
- If you can't successfully run the ` Uninstall-AzureRM ` command, use the
221
- [ ` Uninstall-AzModule ` script] ( #uninstall-script ) provided in this article with the following
222
- invocation:
223
-
224
- ``` powershell-interactive
225
- $Modules = Get-InstalledModule -Name AzureRM -AllVersions
226
- $Modules | ForEach-Object {Uninstall-AzModule -Name $_.Name -Version $_.Version}
227
- ```
0 commit comments