PowerShell Logo Small

Resize-Partition



This is the built-in help made by Microsoft for the command 'Resize-Partition', 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 partition and the underlying file system.

SYNTAX


Resize-Partition [-Size] <UInt64> [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [-Confirm] [-WhatIf]
[<CommonParameters>]
Resize-Partition [-Size] <UInt64> [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-ThrottleLimit <Int32>] -DiskId <String[]> -Offset <UInt64[]> [-Confirm] [-WhatIf]
[<CommonParameters>]
Resize-Partition [-DiskNumber] <UInt32[]> [-PartitionNumber] <UInt32[]> [-Size] <UInt64> [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-ThrottleLimit <Int32>]
[-Confirm] [-WhatIf] [<CommonParameters>]
Resize-Partition [-Size] <UInt64> [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-ThrottleLimit <Int32>] -DriveLetter <Char[]> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Resize-Partition cmdlet resizes a partition and the underlying file system.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=307027
Get-Partition
Get-PartitionSupportedSize

REMARKS

<

Examples


EXAMPLE 1

PS C:\>Get-Partition -DiskNumber 3 -PartitionNumber 2
Disk Number: 3

PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
2 D 135266304 931.39 GB Basic

Resize the partition to 900GB.
PS C:\>Resize-Partition -DiskNumber 3 -PartitionNumber 2 -Size (900GB)


The partition is now 900GB.
PS C:\>Get-Partition -DiskNumber 3 -PartitionNumber 2
Disk Number: 3

PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
2 D 135266304 900 GB Basic

Get the partition sizes.
PS C:\>$size = (Get-PartitionSupportedSize –DiskNumber 3 –PartitionNumber 2)


Resize to the maximum size.
PS C:\>Resize-Partition -DiskNumber 3 –PartitionNumber 2 -Size $size.SizeMax



This example starts with a 931.39 GB partition.