Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Set-Disk

Set-Disk

storagecmdlets.cdxml

Synopsis

Takes a Disk object or unique disk identifiers and a set of attributes, and updates the physical disk on the system.

Syntax

Set-Disk [-Number] [-AsJob] [-CimSession] [-Guid] [-IsReadOnly] [-Signature] [-ThrottleLimit] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-IsOffline] [-ThrottleLimit] [-UniqueId] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-IsOffline] [-ThrottleLimit] [-InputObject] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-IsOffline] [-ThrottleLimit] [-Path] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-PartitionStyle] [-ThrottleLimit] [-InputObject] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-Guid] [-IsReadOnly] [-Signature] [-ThrottleLimit] [-Path] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-Guid] [-IsReadOnly] [-Signature] [-ThrottleLimit] [-UniqueId] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-Guid] [-IsReadOnly] [-Signature] [-ThrottleLimit] [-InputObject] [<CommonParameters>]

Set-Disk [-Number] [-AsJob] [-CimSession] [-IsOffline] [-ThrottleLimit] [<CommonParameters>]

Set-Disk [-Number] [-AsJob] [-CimSession] [-PartitionStyle] [-ThrottleLimit] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-PartitionStyle] [-ThrottleLimit] [-Path] [<CommonParameters>]

Set-Disk [-AsJob] [-CimSession] [-PartitionStyle] [-ThrottleLimit] [-UniqueId] [<CommonParameters>]

Detailed Description

The Set-Disk cmdlet takes a Disk object or unique disk identifiers and a set of attributes, and updates the physical disk on the system.

Parameters

-AsJob <SwitchParameter>

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet. For more information about Windows PowerShell® background jobs, see about_Jobs.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

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

Aliases

Session

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Guid <String>

Contains a globally unique ID (GUID).

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InputObject <CimInstance[]>

Accepts an object from the pipeline as input.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

True (ByValue)

Accept wildcard characters?

false

-IsOffline <Boolean>

Specifies that the disk is offline.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-IsReadOnly <Boolean>

Sets the disk to be read-only, or read-write (read-only = false). Note: If the disk is set to read-only, then the disk must be set to read-only = false before using this cmdlet to set the PartitionStyle parameter.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Number <UInt32>

Specifies a disk number on which the cmdlet acts.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-PartitionStyle <PartitionStyle>

Specifies the type of the partition. The acceptable values for this parameter are: MBR or GPT. The disk must be initialized (such as using theInitialize-Disk cmdlet) and set to read-write (IsReadOnly $false) before this cmdlet will work. The disk must be set to read-only = false before this cmdlet will work.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Path <String>

Contains the device instance path.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-Signature <UInt32>

Contains the signature of the disk.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ThrottleLimit <Int32>

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.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-UniqueId <String>

Specifies an ID used to uniquely identify a Disk object in the system. The ID persists through restarts.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

Input Type

Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Disk

Return Type

None

Notes

None

Examples

EXAMPLE 1

This example takes a disk that is offline and makes it online.

PS C:\>Set-Disk -Number 5 -IsOffline $False

EXAMPLE 2

This example takes a disk that is read-only and makes it writeable.

PS C:\>Set-Disk –Number 5 -IsReadonly $False

Online Version
Clear-Disk
Get-Disk
Initialize-Disk
Update-Disk