June 1st, 2014

PowerTip: Use PowerShell to Test Virtual Hard Disks

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.