What native Windows diagnostics can and cannot establish
Microsoft documents attachment, usability checks, file-system checks, compaction, and storage-provider repair. These operations target different objects. The referenced documentation does not establish a universal Microsoft VHD or VHDX repair tool that fixes a damaged container from its file path.
The following descriptions explain those limits without providing repair commands.
Attachment, detachment, and read-only access
Disk Management's Action > Attach VHD selects an existing .vhd or .vhdx. Documented prerequisites include Backup Operators or Administrators membership. Detach VHD makes the virtual disk unavailable without deleting its file or data. Ordinary attachment is not inherently read-only: Mount-VHD has an explicit ReadOnly option, and Mount-DiskImage documents access modes with a read/write default for VHD. Successful attachment shows that Windows presented the disk; it does not prove intact guest data. Failed attachment does not identify a damaged layer. Microsoft's documented environments do not establish DiskInternals product support.
Test-VHD
This checks usability of a virtual disk or its chain and returns True or False. Its target is the container and any relevant chain. It does not repair the disk or establish complete guest files, successful export, or VM bootability. Protect the original when considering diagnostics; a usability result alone is not an assurance that access to the source is read-only.
CHKDSK
This examines a volume and its file system rather than the container file. Without repair arguments it reports status. The /f switch performs fixes, and several other switches also include repair behavior. Those uses write to the volume. A clean or fixed guest file system does not prove that its container is sound; applying repair switches to a recovery source changes that source.
Optimize-VHD
This compacts a virtual-disk file by reclaiming unused blocks and rearranging blocks. Compaction changes the container, including when the documented prerequisites call for an unattached or read-only disk. It is not corruption repair. Conversion, resizing, and migration to a new disk are separate tasks and are not recovery steps for the damaged source here.
Repair-VirtualDisk
This targets virtual-disk objects managed through Windows Storage Management, with behavior that depends on the storage provider. It is a repair operation on that object, not a universal .vhdx file-path fix. The command's name does not establish that it applies to an ordinary container file or that its result recovers the guest files you need.
Unverified named recipes
DISM, VHDTool, diskpart, vhd-util, and "Repair-VHD" appear in repair suggestions, including Hyper-V and PowerShell discussions. A repeated name does not establish a valid method or its write behavior. Microsoft's referenced Hyper-V cmdlet inventory lists Repair-VM and does not list Repair-VHD. A "not recognized" message concerns command availability or naming in that environment; it is not evidence of disk corruption. The Disk Management attachment and detachment operations described above provide access, not container repair.
Header or footer repair, hex editing, and log replay concern internal structures and can change the source. Leave them to specialist handling. Scripted, remote, or scheduled repair, PowerShell execution-policy changes, and disabling antivirus are not steps in this recovery assessment.