nerdexam
Microsoft

AZ-204 · Question #311

Drag and Drop Question You provision virtual machines (VMs) as development environments. One VM does not start. The VM is stuck in a Windows update process. You attach the OS disk for the affected…

The correct answer is Run the following command at an elevated command prompt: dism /image:\ /get-packages > c:\temp\patch.txt; Open C:\temp\Patch.txt file and locate the update that is in a pending state.; Run the following command at an elevated command prompt: dism /image:\ /Remove-Package /PackageName:<package name to delete>; Detach the OS disk and recreate the VM. The correct order follows a logical troubleshooting sequence: First, use DISM to export all installed packages to a text file (get-packages), then open that text file to identify which update is stuck in a pending state, next use DISM to remove that specific problematic package…

Submitted by olafpl· Mar 30, 2026Troubleshoot and repair Azure Virtual Machines - specifically recovering a VM stuck in a failed Windows Update state using a recovery VM and DISM (Deployment Image Servicing and Management) tool, which falls under the Azure Administrator (AZ-104) domain of 'Monitor and Maintain Azure Resources' or 'Deploy and Manage Azure Compute Resources'.

Question

Drag and Drop Question You provision virtual machines (VMs) as development environments. One VM does not start. The VM is stuck in a Windows update process. You attach the OS disk for the affected VM to a recovery VM. You need to correct the issue. In which order should you perform the actions? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. Answer:

Exhibit

AZ-204 question #311 exhibit

Answer Area

Drag items

Run the following command at an elevated command prompt: dism /image:\ /get-packages > c:\temp\patch.txtRun the following command at an elevated command prompt: dism /image:\ /Remove-Package /PackageName:<package name to delete>Detach the OS disk and recreate the VMOpen C:\temp\Patch.txt file and locate the update that is in a pending state.

Correct arrangement

  • Run the following command at an elevated command prompt: dism /image:\ /get-packages > c:\temp\patch.txt
  • Open C:\temp\Patch.txt file and locate the update that is in a pending state.
  • Run the following command at an elevated command prompt: dism /image:\ /Remove-Package /PackageName:<package name to delete>
  • Detach the OS disk and recreate the VM

Explanation

The correct order follows a logical troubleshooting sequence: First, use DISM to export all installed packages to a text file (get-packages), then open that text file to identify which update is stuck in a pending state, next use DISM to remove that specific problematic package by name, and finally detach the OS disk and recreate/restart the VM to verify the fix. This approach systematically identifies and removes the offending Windows Update package while the OS disk is safely attached to a recovery VM, avoiding the risk of a failed boot loop.

Topics

#Azure VM Recovery#DISM Command-Line Tool#Windows Update Troubleshooting#OS Disk Repair

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice