NAME
Set-Partition
SYNOPSIS
Sets attributes of a partition, such as active, read-only, and offline states.
SYNTAX
Set-Partition [-DiskNumber]
[-PartitionNumber] [-CimSession ] [-GptType
] [-IsActive ] [-IsDAX] [-IsHidden ] [-IsReadOnly ] [-IsShadowCopy] [-MbrType
[] [-NoDefaultDriveLetter ] [-ThrottleLimit ] [-Confirm] [-WhatIf] ] Set-Partition [-DiskNumber]
[-PartitionNumber] [-CimSession ] [-IsOffline
] [-ThrottleLimit ] [-Confirm] [-WhatIf] [ ] Set-Partition [-CimSession
] [-IsOffline ] [-ThrottleLimit ] -DriveLetter [-Confirm] [-WhatIf] [
] Set-Partition [-CimSession
] [-GptType ] [-IsActive ] [-IsDAX] [-IsHidden
] [-IsReadOnly ] [-IsShadowCopy] [-MbrType ] [-NoDefaultDriveLetter ] [-ThrottleLimit
] [-Confirm] [-WhatIf] [ ] Set-Partition [-CimSession
] [-NewDriveLetter ] [-ThrottleLimit ] -DriveLetter [-Confirm] [-WhatIf] [
] Set-Partition [-CimSession
] [-NewDriveLetter ] [-ThrottleLimit ] -DiskId -Offset
[-Confirm] [-WhatIf] [ ] Set-Partition [-CimSession
[] [-NewDriveLetter ] [-ThrottleLimit ] [-Confirm] [-WhatIf] ] Set-Partition [-DiskNumber]
[-PartitionNumber] [-CimSession ] [-NewDriveLetter
] [-ThrottleLimit ] [-Confirm] [-WhatIf] [ ] Set-Partition [-CimSession
] [-IsOffline ] [-ThrottleLimit ] -DiskId -Offset
[-Confirm] [-WhatIf] [ ] Set-Partition [-CimSession
[] [-IsOffline ] [-ThrottleLimit ] [-Confirm] [-WhatIf] ] Set-Partition [-CimSession
] [-GptType ] [-IsActive ] [-IsDAX] [-IsHidden
] [-IsReadOnly ] [-IsShadowCopy] [-MbrType ] [-NoDefaultDriveLetter ] [-ThrottleLimit
] -DriveLetter [-Confirm] [-WhatIf] [ ] Set-Partition [-CimSession
] [-GptType ] [-IsActive ] [-IsDAX] [-IsHidden
] [-IsReadOnly ] [-IsShadowCopy] [-MbrType ] [-NoDefaultDriveLetter ] [-ThrottleLimit
] -DiskId -Offset [-Confirm] [-WhatIf] [ ] DESCRIPTION
The Set-Partition cmdlet sets the attributes of a partition, including active, read-only, hidden, offline, and the
drive letter.PARAMETERS
-CimSession [
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. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false-DiskId
Specifies the disk ID of the partition to modify. Required? true Position? named Default value noneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-DiskNumber
Specifies an array of disk numbers. These represent the disks on which the partitions reside to modify. Required? true Position? 1 Default value noneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-DriveLetter
Specifies the drive letter of the partition to modify. Required? true Position? named Default value noneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-GptType [
Sets the type of a GPT partition to a specific GUID. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -IsActive [
Specifies that the partition is marked as active and can be used to start the system. This parameter is only relevant for MBR disks. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -IsDAX [
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.
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. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -IsOffline [
Takes the partition offline until explicitly brought back online, or until an access path is added to the partition. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -IsReadOnly [
] Sets the partition to be read-only (IsReadOnly $true) or read-write (IsReadOnly $false).
Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false-IsShadowCopy [
Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -MbrType [
Sets the type of an MBR partition to a specific numeric ID. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -NewDriveLetter [
Specifies the new drive letter for the partition. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -NoDefaultDriveLetter [
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. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Offset
Specifies the partition's offset from the beginning of the disk, measured in bytes. Required? true Position? named Default value noneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-PartitionNumber
Specifies the number of the partition. Required? true Position? 2 Default value none Accept pipeline input? false Accept wildcard characters? false-ThrottleLimit [
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 PowerShellr 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. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Confirm [
Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. Required? false Position? named Default value false Accept pipeline input? false Accept wildcard characters? false] -WhatIf [
Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. Required? false Position? named Default value false Accept pipeline input? false Accept wildcard characters? false] This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). INPUTS
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Partition http://msdn.microsoft.com/library/windows/desktop/hh830524.aspx You can pipe a Partition object to the InputObject parameter to specify the partition you want to modify by Partition object.OUTPUTS
NoneExample 1: Set the partition to read-only
PS C:\> Set-Partition -DriveLetter Y -IsReadOnly $True
This example makes partition Y read-only.
Example 2: Set an MBR partition to active
PS C:\> Set-Partition -DriveLetter Y -IsActive $True
This example makes the MBR partition Y active.Example 3: Hide the partition
PS C:\> Set-Partition -DriveLetter Y -IsHidden $True
This example hides partition Y.Example 4: Take the partition offline
PS C:\> Set-Partition -DriveLetter Y -IsOffline $True
This example takes the partition and volume offline.Example 5: Change the drive letter
PS C:\> Set-Partition -DriveLetter Y -NewDriveLetter Z
This example changes the drive letter from Y to Z.RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=816482Get-Partition
New-Partition