Skip to content

Instantly share code, notes, and snippets.

@artisticcheese
Created April 20, 2018 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisticcheese/6098bf84317e76526363121bad46715d to your computer and use it in GitHub Desktop.
Save artisticcheese/6098bf84317e76526363121bad46715d to your computer and use it in GitHub Desktop.
#Requires -Version 3.0
Param(
[string] $ResourceGroupLocation = "southcentralus",
[string] $ResourceGroupName = 'Swarm-RG',
[string] $TemplateFile = 'azuredeploy.json',
[string] $TemplateParametersFile = 'azuredeploy.parameters-show.json'
)
If (-not (Get-AzureRmResourceGroup -Name $ResourceGroupName -ErrorAction SilentlyContinue)) {New-AzureRmResourceGroup -Name $ResourceGroupName -Location $ResourceGroupLocation -Verbose }
New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) `
-ResourceGroupName $ResourceGroupName -TemplateFile $TemplateFile `
-TemplateParameterFile $TemplateParametersFile -Force -Verbose -ErrorVariable ErrorMessages -DeploymentDebugLogLevel All
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment