PowerShell Logo Small

Resize-VHD



This is the built-in help made by Microsoft for the command 'Resize-VHD', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Resizes a virtual hard disk.

SYNTAX


Resize-VHD [-Path] <String[]> [-SizeBytes] <UInt64> [-AsJob] [-ComputerName <String[]>] [-Passthru] [-Confirm] [-WhatIf] [<CommonParameters>]
Resize-VHD [-Path] <String[]> [-AsJob] [-ComputerName <String[]>] [-Passthru] -ToMinimumSize [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


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).


Resize-VHD is an offline operation; the virtual hard disk must not be attached when the operation is initiated.



<

RELATED LINKS


Online Version: http://go.microsoft.com/fwlink/?LinkID=306930

REMARKS

<

Examples


Example 1

PS C:\>Resize-VHD –Path c:\BaseVHD.vhd –SizeBytes 1TB



Expands the VHDX to 1 terabyte (assuming that the previous size was less than the new size prior to the command).




Example 2

PS C:\>Resize-VHD –Path c:\BaseVHDX.vhdx –SizeBytes 1TB



Shrinks the VHDX to one terabyte (assuming that the virtual hard disk object associated with the file path has a MinimumSize less than or equal to 1TB).




Example 3

PS C:\>Resize-VHD –Path c:\BaseVHDX.vhdx –ToMinimumSize



Shrinks the VHDX to its minimum possible size.