< Back
Set-Disk
Post
NAME Set-Disk
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] <UInt32> [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>]
[<CommonParameters>]
Set-Disk [-Number] <UInt32> [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] -Path <String> [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>] -Path <String>
[<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>] -UniqueId <String>
[<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] -UniqueId <String> [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-Number] <UInt32> [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] -Path <String> [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] -UniqueId <String> [<CommonParameters>]
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
-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.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-Guid [<String>]
Contains a globally unique ID (GUID).
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-IsOffline [<Boolean>]
Specifies that the disk is offline.
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.
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.
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.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-Path <String>
Contains the device instance path.
Required? true
Position? named
Default value none
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Signature [<UInt32>]
Contains the signature of the disk.
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.
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.
Required? true
Position? named
Default value none
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
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_Disk
http://msdn.microsoft.com/library/windo ... 30493.aspx
The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The
path after the pound sign (#) provides the namespace and class name for the underlying WMI object.
OUTPUTS
None
EXAMPLE 1
PS C:\\>Set-Disk -Number 5 -IsOffline $False
This example takes a disk that is offline and makes it online.
EXAMPLE 2
PS C:\\>Set-Disk ????????Number 5 -IsReadonly $False
This example takes a disk that is read-only and makes it writeable.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=816477
Clear-Disk
Get-DiskStorageNodeView
Initialize-Disk
Update-Disk
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] <UInt32> [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>]
[<CommonParameters>]
Set-Disk [-Number] <UInt32> [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] -Path <String> [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>] -Path <String>
[<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>] -UniqueId <String>
[<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-Guid <String>] [-IsReadOnly <Boolean>] [-Signature <UInt32>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] -UniqueId <String> [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-IsOffline <Boolean>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-Number] <UInt32> [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] -Path <String> [<CommonParameters>]
Set-Disk [-CimSession <CimSession[]>] [-PartitionStyle {Unknown | MBR | GPT}] [-ThrottleLimit <Int32>] -UniqueId <String> [<CommonParameters>]
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
-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.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-Guid [<String>]
Contains a globally unique ID (GUID).
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-IsOffline [<Boolean>]
Specifies that the disk is offline.
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.
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.
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.
Required? false
Position? named
Default value none
Accept pipeline input? false
Accept wildcard characters? false
-Path <String>
Contains the device instance path.
Required? true
Position? named
Default value none
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Signature [<UInt32>]
Contains the signature of the disk.
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.
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.
Required? true
Position? named
Default value none
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
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_Disk
http://msdn.microsoft.com/library/windo ... 30493.aspx
The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The
path after the pound sign (#) provides the namespace and class name for the underlying WMI object.
OUTPUTS
None
EXAMPLE 1
PS C:\\>Set-Disk -Number 5 -IsOffline $False
This example takes a disk that is offline and makes it online.
EXAMPLE 2
PS C:\\>Set-Disk ????????Number 5 -IsReadonly $False
This example takes a disk that is read-only and makes it writeable.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=816477
Clear-Disk
Get-DiskStorageNodeView
Initialize-Disk
Update-Disk