forked from fabferri/az-pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2hubspoke.ps1
22 lines (17 loc) · 881 Bytes
/
2hubspoke.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
################# Input parameters #################
$subscriptionName = "NAME_YOUR_AZURE_SUBSCRIPTION"
$location = "eastus"
$destResourceGrp = "RG-vnetpeering01"
$resourceGrpDeployment = "deploy-vnetpeering"
$armTemplateFile = "2hubspoke.json"
####################################################
$pathFiles = Split-Path -Parent $PSCommandPath
$templateFile = "$pathFiles\$armTemplateFile"
$subscr=Get-AzureRmSubscription -SubscriptionName $subscriptionName
Select-AzureRmSubscription -SubscriptionId $subscr.Id
$runTime=Measure-Command {
New-AzureRmResourceGroup -Name $destResourceGrp -Location $location
write-host $templateFile
New-AzureRmResourceGroupDeployment -Name $resourceGrpDeployment -ResourceGroupName $destResourceGrp -TemplateFile $templateFile -Verbose
}
write-host -ForegroundColor Yellow "runtime: "$runTime.ToString()