forked from fabferri/az-pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2hubspoke-ilb.ps1
35 lines (29 loc) · 1.26 KB
/
2hubspoke-ilb.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
[CmdletBinding()]
param (
[Parameter( Mandatory = $false, ValueFromPipeline=$false, HelpMessage='username administrator VMs')]
[string]$adminUsername = "ADMINISTRATOR_USERNAME",
[Parameter(Mandatory = $false, HelpMessage='password administrator VMs')]
[string]$adminPassword = "ADMINISTRATOR_PASSWORD"
)
################# Input parameters #################
$subscriptionName = "AzureDemo3"
$location = "eastus"
$rgName = "2"
$rgDeployment = "hubspoke1"
$armTemplateFile = "2hubspoke-ilb.json"
####################################################
$pathFiles = Split-Path -Parent $PSCommandPath
$templateFile = "$pathFiles\$armTemplateFile"
$parameters=@{
"adminUsername"= $adminUsername;
"adminPassword"= $adminPassword
}
$subscr=Get-AzSubscription -SubscriptionName $subscriptionName
Select-AzSubscription -SubscriptionId $subscr.Id
$runTime=Measure-Command {
New-AzResourceGroup -Name $rgName -Location $location
write-host $templateFile
New-AzResourceGroupDeployment -Name $rgDeployment -ResourceGroupName $rgName -TemplateFile $templateFile -TemplateParameterObject $parameters -Verbose
}
write-host -ForegroundColor Yellow "runtime: "$runTime.ToString()