forked from fabferri/az-pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2VNets-1ERcircuit.ps1
36 lines (30 loc) · 1.26 KB
/
2VNets-1ERcircuit.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
36
#
#
[CmdletBinding()]
param (
[Parameter( Mandatory = $false, ValueFromPipeline=$false, HelpMessage='username administrator VMs')]
[string]$adminUsername = "YOUR_ADMIN_USERNAME",
[Parameter(Mandatory = $false, HelpMessage='password administrator VMs')]
[string]$adminPassword = "YOUR_ADMIN_PASSWORD"
)
################# Input parameters #################
$subscriptionName = "AzDev"
$location = "northeurope"
$rgName = "1-test"
$rgDeployment = "dep01"
$armTemplateFile = "2VNets-1ERcircuit.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()