11
11
# See the License for the specific language governing permissions and
12
12
# limitations under the License.
13
13
# ----------------------------------------------------------------------------------
14
- [CmdletBinding ()]
14
+ [CmdletBinding (DefaultParametersetName = " none " )]
15
15
Param (
16
- [Parameter (Mandatory = $False , HelpMessage = " Use Install parameter to install Azure modules from PowerShell Gallery." )]
17
- [switch ]$Install
16
+ [Parameter (Mandatory = $True , HelpMessage = " Use Install parameter to install Azure modules from PowerShell Gallery." , ParameterSetName = " install" )]
17
+ [switch ]$Install ,
18
+ [Parameter (Mandatory = $True , HelpMessage = " Use Uninstall parameter to uninstall Azure modules from PowerShell Gallery." , ParameterSetName = " uninstall" )]
19
+ [switch ]$Uninstall
18
20
)
19
21
20
22
function EnsureRegistryPath
38
40
Write-Output @"
39
41
40
42
Finalizing installation of Azure PowerShell.
41
- Installing Azure Modules from PowerShell Gallery.
43
+ Installing AzureRM Modules from PowerShell Gallery.
42
44
This may take some time...
43
45
"@
44
46
$env: PSModulePath = " $env: USERPROFILE \Documents\WindowsPowerShell\Modules;$env: ProgramFiles \WindowsPowerShell\Modules;$env: SystemRoot \system32\WindowsPowerShell\v1.0\Modules\"
@@ -59,7 +61,20 @@ This may take some time...
59
61
Write-Output " AzureRM $ ( (Get-InstalledModule - Name AzureRM)[0 ].Version) installed..."
60
62
61
63
Update-AzureRM - Repository $DefaultPSRepository
62
- } else {
64
+ }
65
+ elseif ($Uninstall.IsPresent )
66
+ {
67
+ Write-Output @"
68
+
69
+ Finalizing uninstallation of Azure PowerShell.
70
+ This may take some time...
71
+ "@
72
+ $env: PSModulePath = " $env: USERPROFILE \Documents\WindowsPowerShell\Modules;$env: ProgramFiles \WindowsPowerShell\Modules;$env: SystemRoot \system32\WindowsPowerShell\v1.0\Modules\"
73
+
74
+ Uninstall-AzureRM
75
+ }
76
+ else
77
+ {
63
78
cd c:\
64
79
$welcomeMessage = @"
65
80
For a list of all Azure RM cmdlets type 'help azurerm'.
0 commit comments