Skip to content

Instantly share code, notes, and snippets.

@esarabadani
Created December 13, 2017 10:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save esarabadani/691b7328a34fb2ae1380a11b78de8fc8 to your computer and use it in GitHub Desktop.
$vmssObject = Get-AzureRmVmss -ResourceGroupName $greenrg -VMScaleSetName $vmssName
$vmssObject.virtualMachineProfile.storageProfile.osDisk.image.uri= $newImageURI
$instances = Get-AzureRmVmssVM -VMScaleSetName $vmssName -ResourceGroupName $greenrg
foreach($instance in $instances){
Update-AzureRmVmssInstance -ResourceGroupName $greenrg -VMScaleSetName $vmssName -InstanceId $instance.InstanceID
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment