mirror of
https://github.com/MichaelCade/90DaysOfDevOps.git
synced 2025-01-10 07:06:38 +07:00
21 lines
805 B
PowerShell
21 lines
805 B
PowerShell
$rgName = '90DaysOfDevOps'
|
|
|
|
New-AzResourceGroupDeployment `
|
|
-ResourceGroupName $rgName `
|
|
-TemplateFile C:\Users\micha\demo\90DaysOfDevOps\Days\Cloud\02TrafficManagement\Mod06_90DaysOfDevOps-vms-loop-template.json `
|
|
-TemplateParameterFile C:\Users\micha\demo\90DaysOfDevOps\Days\Cloud\02TrafficManagement\Mod06_90DaysOfDevOps-vms-loop-parameters.json
|
|
|
|
$location = (Get-AzResourceGroup -ResourceGroupName $rgName).location
|
|
$vmNames = (Get-AzVM -ResourceGroupName $rgName).Name
|
|
|
|
foreach ($vmName in $vmNames) {
|
|
Set-AzVMExtension `
|
|
-ResourceGroupName $rgName `
|
|
-Location $location `
|
|
-VMName $vmName `
|
|
-Name 'networkWatcherAgent' `
|
|
-Publisher 'Microsoft.Azure.NetworkWatcher' `
|
|
-Type 'NetworkWatcherAgentWindows' `
|
|
-TypeHandlerVersion '1.4'
|
|
}
|
|
|