Skip to content

Commit 59e6fc5

Browse files
committed
Added AzureRM.Installer module
1 parent 5166469 commit 59e6fc5

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
8.53 KB
Binary file not shown.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<#
2+
.Synopsis
3+
Install Azure Resource Manager cmdlet modules
4+
5+
.Description
6+
Installs all the available Azure Resource Manager cmdlet modules that start with "AzureRM".
7+
8+
.Parameter Repository
9+
Limit the search for "AzureRM" cmdlets in a specific repository.
10+
11+
.Parameter Scope
12+
Specifies the parameter scope.
13+
#>
14+
function Install-AzureRM
15+
{
16+
param(
17+
[Parameter(Position=0, Mandatory = $false)]
18+
[string]
19+
$Repository,
20+
21+
[Parameter(Position=1, Mandatory = $false)]
22+
[ValidateSet("CurrentUser","AllUsers")]
23+
[string]
24+
$Scope)
25+
26+
if ([string]::IsNullOrWhiteSpace($Scope))
27+
{
28+
$Scope = "AllUsers"
29+
}
30+
31+
# Retrieve a list of modules
32+
if ([string]::IsNullOrWhiteSpace($Repository))
33+
{
34+
$modules = Find-Module -Name AzureRM.* | Where-Object {$_.Name -ne "AzureRM.Installer"}
35+
Install-Module $modules -Scope $Scope
36+
}
37+
else
38+
{
39+
$modules = Find-Module -Repository $Repository | Where-Object {$_.Name -like "AzureRM.*" -and $_.Name -ne "AzureRM.Installer"}
40+
Install-Module $modules -Repository $Repository -Scope $Scope
41+
}
42+
}
43+
44+
<#
45+
.Synopsis
46+
Updates Azure Resource Manager cmdlet modules
47+
48+
.Description
49+
Updates all installed Azure Resource Manager cmdlet modules that start with "AzureRM".
50+
#>
51+
function Update-AzureRM
52+
{
53+
$modules = Get-InstalledModule -Name AzureRM.*
54+
$modules | Update-Module
55+
}

0 commit comments

Comments
 (0)