Which PowerShell cmdlet option you should run first?

You run a Windows 2012 R2 Hyper-V Role Server, you need to shrink the size of files.vhd.
Which PowerShell cmdlet option you should run first?

You run a Windows 2012 R2 Hyper-V Role Server, you need to shrink the size of files.vhd.
Which PowerShell cmdlet option you should run first?

A.
Dismount-VHD

B.
Mount-VHD

C.
Resize-VHD

D.
Convert-VHD



Leave a Reply to JamesL Cancel reply4

Your email address will not be published. Required fields are marked *

2 × five =


Special K

Special K

C

https://technet.microsoft.com/en-us/library/hh848535.aspx

The Resize-VHD cmdlet resizes a virtual hard disk. This cmdlet lets you shrink or expand the size of a virtual hard disk, but the shrink operation is allowed only on VHDX virtual hard disks. The shrink operation fails if it would shrink the virtual disk to less than its minimum size (available through the VHDX object’s MinimumSize property).

Special K

Special K

Never mind, D is correct.”the shrink operation is allowed only on VHDX virtual hard disks” thus the .vhd must be converted first.

Gordon Freeman

Gordon Freeman

The answer is A, Dismount-VHD. Convert-VHD will throw an exception if the source VHD is mounted. The correct sequence of events is:

A: Dismount-VHD
D: Convert-VHD
C: Resize-VHD
B: Mount-VHD

JamesL

JamesL

Agree with Gordon Freeman

Resize-VHD is an offline operation; the virtual hard disk must not be attached when the operation is initiated. Therefore we must dismount the vhd first

The shrink operation is allowed only on VHDX virtual hard disks. Therefore we must convert the vhd to vhdx

then resize

then mount again

https://technet.microsoft.com/en-us/library/hh848535.aspx