description | external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|---|
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. |
StorageCmdlets.cdxml-help.xml |
Storage |
12/20/2016 |
2.0.0 |
Set-Partition |
Sets attributes of a partition, such as active, read-only, and offline states.
Set-Partition [-IsReadOnly <Boolean>] [-NoDefaultDriveLetter <Boolean>] [-IsActive <Boolean>]
[-IsHidden <Boolean>] [-IsShadowCopy <Boolean>] [-IsDAX <Boolean>] [-MbrType <UInt16>] [-GptType <String>]
[-DiskNumber] <UInt32> [-PartitionNumber] <UInt32> [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>]
[-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition -InputObject <CimInstance[]> [-NewDriveLetter <Char>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition -InputObject <CimInstance[]> [-IsOffline <Boolean>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition -InputObject <CimInstance[]> [-IsReadOnly <Boolean>] [-NoDefaultDriveLetter <Boolean>]
[-IsActive <Boolean>] [-IsHidden <Boolean>] [-IsShadowCopy <Boolean>] [-IsDAX <Boolean>] [-MbrType <UInt16>]
[-GptType <String>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm]
[<CommonParameters>]
Set-Partition [-IsReadOnly <Boolean>] [-NoDefaultDriveLetter <Boolean>] [-IsActive <Boolean>]
[-IsHidden <Boolean>] [-IsShadowCopy <Boolean>] [-IsDAX <Boolean>] [-MbrType <UInt16>] [-GptType <String>]
-DriveLetter <Char> [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm]
[<CommonParameters>]
Set-Partition [-IsReadOnly <Boolean>] [-NoDefaultDriveLetter <Boolean>] [-IsActive <Boolean>]
[-IsHidden <Boolean>] [-IsShadowCopy <Boolean>] [-IsDAX <Boolean>] [-MbrType <UInt16>] [-GptType <String>]
-DiskId <String> -Offset <UInt64> [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf]
[-Confirm] [<CommonParameters>]
Set-Partition -DiskId <String> -Offset <UInt64> [-NewDriveLetter <Char>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition -DiskId <String> -Offset <UInt64> [-IsOffline <Boolean>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition -DriveLetter <Char> [-NewDriveLetter <Char>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition -DriveLetter <Char> [-IsOffline <Boolean>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>]
[-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition [-DiskNumber] <UInt32> [-PartitionNumber] <UInt32> [-NewDriveLetter <Char>]
[-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Partition [-DiskNumber] <UInt32> [-PartitionNumber] <UInt32> [-IsOffline <Boolean>]
[-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
The Set-Partition cmdlet sets the attributes of a partition, including active, read-only, hidden, offline, and the drive letter.
PS C:\> Set-Partition -DriveLetter Y -IsReadOnly $True
This example makes partition Y read-only.
PS C:\> Set-Partition -DriveLetter Y -IsActive $True
This example makes the MBR partition Y active.
PS C:\> Set-Partition -DriveLetter Y -IsHidden $True
This example hides partition Y.
PS C:\> Set-Partition -DriveLetter Y -IsOffline $True
This example takes the partition and volume offline.
PS C:\> Set-Partition -DriveLetter Y -NewDriveLetter Z
This example changes the drive letter from Y to Z.
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
Type: CimSession[]
Parameter Sets: (All)
Aliases: Session
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies the disk ID of the partition to modify.
Type: String
Parameter Sets: ByIdAttributes, ByIdAccessPath, ById
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies an array of disk numbers. These represent the disks on which the partitions reside to modify.
Type: UInt32
Parameter Sets: ByNumberAttributes, ByNumberAccessPath, ByNumber
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the drive letter of the partition to modify.
Type: Char
Parameter Sets: ByDriveLetterAttributes, ByDriveLetterAccessPath, ByDriveLetter
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Sets the type of a GPT partition to a specific GUID.
Type: String
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the input object that is used in a pipeline command.
Type: CimInstance[]
Parameter Sets: ByObjectAccessPath, ByObject, ByObjectAttributes
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specifies that the partition is marked as active and can be used to start the system. This parameter is only relevant for MBR disks.
Type: Boolean
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Formats a volume as a DirectAccess (DAX) volume.
DAX provides applications with direct access and byte-addressability options via memory mapping on storage class memory (SCM) devices, such as NVDIMM-N.
If you do not specify the IsDAX parameter, the cmdlet defaults to a regular, non-DAX volume.
Type: Boolean
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IsHidden
Specifies that the partition is hidden. As a result, the partition does not receive a drive letter, does not receive a volume GUID path, and does not host volume mount points. This ensures that applications such as disk defragmenter do not access the partition.
Type: Boolean
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Takes the partition offline until explicitly brought back online, or until an access path is added to the partition.
Type: Boolean
Parameter Sets: ByObject, ById, ByDriveLetter, ByNumber
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Sets the partition to be read-only (IsReadOnly $true
) or read-write (IsReadOnly $false
).
Type: Boolean
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: Boolean
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Sets the type of an MBR partition to a specific numeric ID.
Type: UInt16
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the new drive letter for the partition.
Type: Char
Parameter Sets: ByObjectAccessPath, ByIdAccessPath, ByDriveLetterAccessPath, ByNumberAccessPath
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies that the automatic assignment of a drive letter is disabled. This is only honored for GPT disks. This attribute is useful in storage area network (SAN) environments.
Type: Boolean
Parameter Sets: ByNumberAttributes, ByObjectAttributes, ByDriveLetterAttributes, ByIdAttributes
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the partition's offset from the beginning of the disk, measured in bytes.
Type: UInt64
Parameter Sets: ByIdAttributes, ByIdAccessPath, ById
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the number of the partition.
Type: UInt32
Parameter Sets: ByNumberAttributes, ByNumberAccessPath, ByNumber
Aliases: Number
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.
If this parameter is omitted or a value of 0
is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You can pipe a Partition object to the InputObject parameter to specify the partition you want to modify by Partition object.
- When used in Failover Cluster, cmdlets from the Storage module operate on cluster level (all servers in the cluster).