PowerTip: Use PowerShell to Test Virtual Hard Disks


Summary: Use Windows PowerShell to test your virtual hard disks.

Hey, Scripting Guy! Question How can I easily test the virtual hard disks on my Windows 8.1 laptop to ensure that they will work?

Hey, Scripting Guy! Answer Get a collection of all .vhd and .vhdx disks, then pipe the resulting objects to the Test-VHD cmdlet:

Get-ChildItem -Path E:\vms\ -Recurse -Include *.vh* | Test-VHD

You can shorten the command to:

gci E:\vms\ -r -in *.vh* | Test-VHD

Comments (1)

Skip to main content