Get-PhysicalDisk

Get-PhysicalDisk

Gets a list of all PhysicalDisk objects visible across any available Storage Management Providers, or optionally a filtered list.

Syntax

Parameter Set: ByUniqueId
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]> ] [-CimSession <CimSession[]> ] [-Description <String[]> ] [-HealthStatus <HealthStatus[]> ] [-Manufacturer <String[]> ] [-Model <String[]> ] [-ThrottleLimit <Int32> ] [-UniqueId <String[]> ] [-Usage <Usage[]> ] [ <CommonParameters>]

Parameter Set: ByName
Get-PhysicalDisk [[-FriendlyName] <String[]> ] [-AsJob] [-CanPool <Boolean[]> ] [-CimSession <CimSession[]> ] [-Description <String[]> ] [-HealthStatus <HealthStatus[]> ] [-Manufacturer <String[]> ] [-Model <String[]> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]

Parameter Set: ByStoragePool
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]> ] [-CimSession <CimSession[]> ] [-Description <String[]> ] [-HealthStatus <HealthStatus[]> ] [-Manufacturer <String[]> ] [-Model <String[]> ] [-StoragePool <CimInstance> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]

Parameter Set: ByStorageSubSystem
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]> ] [-CimSession <CimSession[]> ] [-Description <String[]> ] [-HealthStatus <HealthStatus[]> ] [-Manufacturer <String[]> ] [-Model <String[]> ] [-StorageSubSystem <CimInstance> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]

Parameter Set: ByVirtualDisk
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]> ] [-CimSession <CimSession[]> ] [-Description <String[]> ] [-HasAllocations <Boolean> ] [-HealthStatus <HealthStatus[]> ] [-Manufacturer <String[]> ] [-Model <String[]> ] [-SelectedForUse <Boolean> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [-VirtualDisk <CimInstance> ] [-VirtualRangeMax <UInt64> ] [-VirtualRangeMin <UInt64> ] [ <CommonParameters>]

Detailed Description

The Get-PhysicalDisk cmdlet gets a list of all PhysicalDisk objects visible across any available Storage Management Providers, or optionally a filtered list of disks.

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CanPool<Boolean[]>

Gets physical disks that are available for use in a storage pool.

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

-Description<String[]>

Gets the physical disks that contain the specified description. Enter a description, or use wildcard characters to enter a description pattern.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FriendlyName<String[]>

Gets the physical disk with the specified friendly name. Enter a friendly name, or use wildcard characters to enter a name pattern.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-HasAllocations<Boolean>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HealthStatus<HealthStatus[]>

Gets only physical disks in the specified state. Valid values are Healthy, Unhealthy, Unknown, or Warning.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Manufacturer<String[]>

Gets the physical disks with the specified manufacturer. Enter a manufacturer string, or use wildcard characters to enter a pattern.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Model<String[]>

Gets the physical disks of the specified model. Enter a model string or use wildcard characters to enter a pattern.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SelectedForUse<Boolean>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StoragePool<CimInstance>

Accepts a StoragePool object as input and gets the physical disks that belong to the pool. The Storage Pool CIM object is exposed by the Get-StoragePool cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-StorageSubSystem<CimInstance>

Accepts a StorageSubsystem object as input and gets the physical disks attached to the storage subsystem. The Storage Subsystem CIM object is exposed by the Get-StorageSubSystem cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

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[]>

Gets only the physical disks with the specified IDs. Type one or more IDs (separated by commas), or use wildcard characters to enter a pattern.

Aliases

Id

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Usage<Usage[]>

Gets only the physical disks with the specified allocation method (usage) of the disk. Valid values are AutoSelect, HotSpare, Journal, ManualSelect, Retired, and Unknown.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualDisk<CimInstance>

Accepts a VirtualDisk object as input and gets the physical disks used by the virtual disk. The VirtualDisk object is exposed by the Get-VirtualDisk cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VirtualRangeMax<UInt64>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualRangeMin<UInt64>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StoragePool

    You can pipe an MSFT_StoragePool object to the StoragePool parameter.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageSubsystem

    You can pipe an MSFT_StorageSubsystem object to the StorageSubsystem parameter.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk

    You can pipe an MSFT_VirtualDisk object to the VirtualDisk parameter.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_PhysicalDisk

    The Get-PhysicalDisk cmdlet returns objects that represent physical disks.

Notes

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

Examples

Example 1: Getting all physical disks

This example returns an array of all PhysicalDisk objects present in the computer. A storage management provider is required to manage physical disks.

PS C:\> Get-PhysicalDisk

Example 2: Getting all physical disks eligible for adding to a storage pool

This example returns an array of PhysicalDisk objects that are available for adding to a storage pool (they are in a primordial pool).

PS C:\> Get-PhysicalDisk -CanPool $True

Add-PhysicalDisk

Get-StoragePool

New-StoragePool

Remove-PhysicalDisk

Reset-PhysicalDisk

Set-PhysicalDisk