New-Partition

New-Partition

Creates a new partition on an existing Disk object.

構文

Parameter Set: ByNumber
New-Partition [-DiskNumber] <UInt32[]> [-Alignment <UInt32> ] [-AsJob] [-AssignDriveLetter] [-CimSession <CimSession[]> ] [-DriveLetter <Char> ] [-GptType <String> ] [-IsActive] [-IsHidden] [-MbrType <MbrType> ] [-Offset <UInt64> ] [-Size <UInt64> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [ <CommonParameters>]

Parameter Set: ByPath
New-Partition -DiskPath <String[]> [-Alignment <UInt32> ] [-AsJob] [-AssignDriveLetter] [-CimSession <CimSession[]> ] [-DriveLetter <Char> ] [-GptType <String> ] [-IsActive] [-IsHidden] [-MbrType <MbrType> ] [-Offset <UInt64> ] [-Size <UInt64> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [ <CommonParameters>]

Parameter Set: ByUniqueId
New-Partition -DiskId <String[]> [-Alignment <UInt32> ] [-AsJob] [-AssignDriveLetter] [-CimSession <CimSession[]> ] [-DriveLetter <Char> ] [-GptType <String> ] [-IsActive] [-IsHidden] [-MbrType <MbrType> ] [-Offset <UInt64> ] [-Size <UInt64> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [ <CommonParameters>]

Parameter Set: InputObject (cdxml)
New-Partition -InputObject <CimInstance[]> [-Alignment <UInt32> ] [-AsJob] [-AssignDriveLetter] [-CimSession <CimSession[]> ] [-DriveLetter <Char> ] [-GptType <String> ] [-IsActive] [-IsHidden] [-MbrType <MbrType> ] [-Offset <UInt64> ] [-Size <UInt64> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [ <CommonParameters>]

詳細説明

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

パラメーター

-Alignment<UInt32>

Specifies the alignment boundary in bytes.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-AsJob

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-AssignDriveLetter

Assigns a drive letter to the new partition.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CimSession<CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。

エイリアス

Session

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DiskId<String[]>

Specifies the ID of the disk on which to create the partition.

エイリアス

Id

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DiskNumber<UInt32[]>

Specifies the number of the disk.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DiskPath<String[]>

Specifies the path of the disk on which to create the partition.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DriveLetter<Char>

Specifies the specific drive letter to assign to the new partition.

エイリアス

NewDriveLetter

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-GptType<String>

Specifies the type of GPT partition to create (by GUID). By default, the New-Partition cmdlet creates a basic GPT data partition.

The GUIDs of valid types are:
-- System Partition (c12a7328-f81f-11d2-ba4b-00a0c93ec93b)
-- Microsoft Reserved (e3c9e316-0b5c-4db8-817d-f92df00215ae)
-- Basic data (ebd0a0a2-b9e5-4433-87c0-68b6b72699c7)
-- Microsoft Recovery (de94bba4-06d1-4d40-a16a-bfd50179d6ac)

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-InputObject<CimInstance[]>

このコマンドレットへの入力を指定します。このパラメーターを使用するか、パイプを使用して入力をこのコマンドレットに渡すことができます。

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-IsActive

Specifies that the object is marked active.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-IsHidden

Creates a hidden partition.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-MbrType<MbrType>

Specifies the type of MBR partition to create. Valid types are: Extended, FAT12, FAT16, FAT32, Huge, and IFS.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Offset<UInt64>

Specifies the starting offset, in bytes.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Size<UInt64>

Specifies the size of the partition to create. If not specified, then the units will default to Bytes. The acceptable value for this parameter is a positive number followed by the one of the following unit values: Bytes, KB, MB, GB, or TB.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ThrottleLimit<Int32>

このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0 を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-UseMaximumSize

Creates the largest possible partition on the specified disk.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.Management.Infrastructure.CimInstance オブジェクトは、Windows Management Instrumentation (WMI) オブジェクトを表示するラッパー クラスです。シャープ記号 (#) の後のパスは、基になる WMI オブジェクトの名前空間とクラス名です。

Example 1: Create a new partition on disk 1

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

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

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

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.

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

関連トピック

Add-PartitionAccessPath

Get-Partition

Set-Partition

Initialize-Disk

Format-Volume

Select-Object