PowerShell Logo Small

Set-Partition



This is the built-in help made by Microsoft for the command 'Set-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

Sets attributes of a partition, such as active, read-only, and offline states.

SYNTAX


Set-Partition [-DiskNumber] <UInt32> [-PartitionNumber] <UInt32> [-AsJob] [-CimSession <CimSession[]>] [-IsActive <Boolean>] [-IsHidden <Boolean>] [-IsReadOnly <Boolean>]
[-NoDefaultDriveLetter <Boolean>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-IsActive <Boolean>] [-IsHidden <Boolean>] [-IsReadOnly <Boolean>] [-NoDefaultDriveLetter <Boolean>] [-ThrottleLimit
<Int32>] -InputObject <CimInstance[]> [<CommonParameters>]
Set-Partition [-DiskNumber] <UInt32> [-PartitionNumber] <UInt32> [-AsJob] [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-IsActive <Boolean>] [-IsHidden <Boolean>] [-IsReadOnly <Boolean>] [-NoDefaultDriveLetter <Boolean>] [-ThrottleLimit
<Int32>] -DiskId <String> -Offset <UInt64> [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-NewDriveLetter <Char>] [-ThrottleLimit <Int32>] -DriveLetter <Char> [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-NewDriveLetter <Char>] [-ThrottleLimit <Int32>] -DiskId <String> -Offset <UInt64> [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-NewDriveLetter <Char>] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [<CommonParameters>]
Set-Partition [-DiskNumber] <UInt32> [-PartitionNumber] <UInt32> [-AsJob] [-CimSession <CimSession[]>] [-NewDriveLetter <Char>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] -DriveLetter <Char> [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] -DiskId <String> -Offset <UInt64> [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [<CommonParameters>]
Set-Partition [-AsJob] [-CimSession <CimSession[]>] [-IsActive <Boolean>] [-IsHidden <Boolean>] [-IsReadOnly <Boolean>] [-NoDefaultDriveLetter <Boolean>] [-ThrottleLimit
<Int32>] -DriveLetter <Char> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-Partition cmdlet sets the attributes of a partition, including active, read-only, hidden, offline, and the drive letter.



<

RELATED LINKS

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

REMARKS

<

Examples


Example 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.