Skip to content

Commit 9e3274f

Browse files
authored
Merge pull request #108507 from mbsnl/patch-4
Update automatic-vm-guest-patching.md - PowerShell command error
2 parents 46a0e1a + 1d1ea07 commit 9e3274f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/virtual-machines/automatic-vm-guest-patching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName
239239
Use the [Set-AzVMOperatingSystem](/powershell/module/az.compute/set-azvmoperatingsystem) and [Update-AzVM](/powershell/module/az.compute/update-azvm) cmdlet to enable automatic VM guest patching on an existing VM.
240240

241241
```azurepowershell-interactive
242-
Get-AzVM -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential
242+
$VirtualMachine = Get-AzVM -ResourceGroupName "myResourceGroup" -Name "myVM"
243243
Set-AzVMOperatingSystem -VM $VirtualMachine -PatchMode "AutomaticByPlatform"
244244
Update-AzVM -VM $VirtualMachine
245245
```

0 commit comments

Comments
 (0)