1111# See the License for the specific language governing permissions and
1212# limitations under the License.
1313# ----------------------------------------------------------------------------------
14- [CmdletBinding ()]
14+ [CmdletBinding (DefaultParametersetName = " none " )]
1515Param (
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
1820)
1921
2022function EnsureRegistryPath
3840 Write-Output @"
3941
4042Finalizing installation of Azure PowerShell.
41- Installing Azure Modules from PowerShell Gallery.
43+ Installing AzureRM Modules from PowerShell Gallery.
4244This may take some time...
4345"@
4446 $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...
5961 Write-Output " AzureRM $ ( (Get-InstalledModule - Name AzureRM)[0 ].Version) installed..."
6062
6163 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+ {
6378 cd c:\
6479 $welcomeMessage = @"
6580For a list of all Azure RM cmdlets type 'help azurerm'.
0 commit comments