Public/New-SimpleArmResourceGroup.ps1
function New-SimpleArmResourceGroup { [CmdletBinding()] param ( [Parameter()][string]$ResourceName, [Parameter()][string]$WorkingDir, [Parameter()][string]$Location, [Parameter()][string]$Environment ) $stopWatch = [System.Diagnostics.Stopwatch]::StartNew() Write-Information "Deploying $resourceName" $resourceDir = "$workingDir\$resourceName" $deploymentName = Get-DeploymentName -ResourceName $resourceName $result = Invoke-SimpleArmExecute -arguments "/c `"az deployment sub create --no-prompt --name $deploymentName --location ""$location"" --template-file $resourceDir\$resourceName.json --parameters $resourceDir\$resourceName.parameters.$environment.json --query properties.provisioningState`"" $stopWatch.stop() Write-Information "Deployment complete - Tried to create group $resourceName in environment $environment - Operation took $($stopWatch.Elapsed.TotalSeconds) sec - Result $result.StdOut" } |