Override a parameter in the parameters.json file with PowerShell when deploying ARM template
To overwrite the paramter at runtime you can just specify it when invoking the New-AzureRmResourceGroupDeployment
cmdlet:
New-AzureRmResourceGroupDeployment ` -TemplateFile D:\tmp\azuredeploy.json ` -TemplateParameterFile D:\tmp\azuredeploy.json ` -<yourParameterNameHere> $vnetName ` -ResourceGroupName myRg
You could also permanently overwrite the json file itself using PowerShell:
$paramFile = Get-Content d:\tmp\azuredeploy.parameters.json | ConvertFrom-Json$paramFile.parameters.vnetName.value = $vnetName $paramFile | ConvertTo-Json | Set-Content d:\tmp\azuredeploy.parameters.json