PowerShell Logo Small

New-Partition



This is the built-in help made by Microsoft for the command 'New-Partition', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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

Creates a new partition on an existing Disk object.

SYNTAX


New-Partition [-DiskNumber] <UInt32[]> [-Alignment <UInt32>] [-AsJob [<SwitchParameter>]] [-AssignDriveLetter [<SwitchParameter>]]
[-CimSession <CimSession[]>] [-DriveLetter <Char>] [-GptType <String>] [-IsActive [<SwitchParameter>]] [-IsHidden [<SwitchParameter>]]
[-MbrType <MbrType>] [-Offset <UInt64>] [-Size <UInt64>] [-ThrottleLimit <Int32>] [-UseMaximumSize [<SwitchParameter>]] [<CommonParameters>]
New-Partition [-Alignment <UInt32>] [-AsJob [<SwitchParameter>]] [-AssignDriveLetter [<SwitchParameter>]] [-CimSession <CimSession[]>]
[-DriveLetter <Char>] [-GptType <String>] [-IsActive [<SwitchParameter>]] [-IsHidden [<SwitchParameter>]] [-MbrType <MbrType>] [-Offset
<UInt64>] [-Size <UInt64>] [-ThrottleLimit <Int32>] [-UseMaximumSize [<SwitchParameter>]] -DiskPath <String[]> [<CommonParameters>]
New-Partition [-Alignment <UInt32>] [-AsJob [<SwitchParameter>]] [-AssignDriveLetter [<SwitchParameter>]] [-CimSession <CimSession[]>]
[-DriveLetter <Char>] [-GptType <String>] [-IsActive [<SwitchParameter>]] [-IsHidden [<SwitchParameter>]] [-MbrType <MbrType>] [-Offset
<UInt64>] [-Size <UInt64>] [-ThrottleLimit <Int32>] [-UseMaximumSize [<SwitchParameter>]] -DiskId <String[]> [<CommonParameters>]
New-Partition [-Alignment <UInt32>] [-AsJob [<SwitchParameter>]] [-AssignDriveLetter [<SwitchParameter>]] [-CimSession <CimSession[]>]
[-DriveLetter <Char>] [-GptType <String>] [-IsActive [<SwitchParameter>]] [-IsHidden [<SwitchParameter>]] [-MbrType <MbrType>] [-Offset
<UInt64>] [-Size <UInt64>] [-ThrottleLimit <Int32>] [-UseMaximumSize [<SwitchParameter>]] -InputObject <CimInstance[]> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The New-Partiton cmdlet creates a partition on a specified Disk object. Note: This cmdlet does not support creating dynamic volumes.



<

RELATED LINKS

Select-Object
Add-PartitionAccessPath
Get-Partition
Set-Partition
Initialize-Disk
Format-Volume

REMARKS

<

Examples


Example 1: Create a new partition on disk 1

PS C:\> New-Partiton -DiskNumber 1 -UseMaximumSize -AssignDriveLetter



This example creates a new partition on disk 1, using the maximum available space, and automatically assigning a drive letter.




Example 2: Get all RAW disks, initialize the disks, partition, and format them

This line gets all disk objects and then pipes the objects to the next command.
PS C:\> Get-Disk |

This line selects only objects where the PartitionStyle property value equals "RAW", and then pipes the objects to the next command.
PS C:\> Where-Object PartitionStyle –Eq "RAW" |

This line initializes all Disk objects in the pipeline and then pipes the objects to the next cmdlet.
PS C:\> Initialize-Disk -PassThru |

This line creates a maximum sized partition on each initialized Disk object, assigns a drive letter to the partitions, and then pipes the
objects to the next cmdlet.
PS C:\> New-Partition -AssignDriveLetter -UseMaximumSize |

This line formats all newly partitioned disks.
PS C:\> Format-Volume



This example uses five cmdlets and the pipeline to get all disks, filter them for only RAW, unpartitioned disks, initialize the disks,
partition the disks, and then format them.