Re-size VHD
Re-sizes 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 minimum size property). Resize-VHD is an offline operation. The virtual hard disk must not be attached when the operation is initiated.
Input Parameters
VHD File Path |
String |
Yes |
Specifies the path to the virtual hard disk that is to be resized. |
Shrink to Minimum Size |
Boolean |
No |
Specifies that the virtual hard disk is to be resized to its minimum possible size. |
New Size |
String |
No |
Specifies the size to which the virtual hard disk is to be resized. |
Output Parameters
Result |
Number |
Returns a success value of zero or any value other than zero to indicate failure. |
Example Input Parameters
VHD File Path |
String |
Yes |
c:\test\testvhdx.vhdx |
Shrink to Minimum Size |
Boolean |
No |
Optionally, you can shrink the VHD to the minimum possible size. |
New Size |
String |
No |
1TB |