Edit

Share via


Get-VirtualDisk

Returns a list of VirtualDisk objects, across all storage pools, across all providers, or optionally a filtered subset based on provided criteria.

Syntax

ByFriendlyName (Default)

Get-VirtualDisk
    [[-FriendlyName] <String[]>]
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByUniqueId

Get-VirtualDisk
    [-UniqueId <String[]>]
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByName

Get-VirtualDisk
    [-Name <String[]>]
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByStorageJob

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-StorageJob <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByTargetVirtualDisk

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-TargetVirtualDisk <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

BySourceVirtualDisk

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-SourceVirtualDisk <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByTargetPort

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-TargetPort <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByInitiatorId

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-InitiatorId <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByMaskingSet

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-MaskingSet <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByInitiatorPort

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-InitiatorPort <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByDisk

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-Disk <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByStorageTier

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-StorageTier <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByPhysicalDisk

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-PhysicalDisk <CimInstance>]
    [-PhysicalRangeMin <UInt64>]
    [-PhysicalRangeMax <UInt64>]
    [-NoRedundancy]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByStoragePool

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-StoragePool <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByStorageNode

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-StorageNode <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByStorageSubSystem

Get-VirtualDisk
    [-Usage <Usage[]>]
    [-OtherUsageDescription <String[]>]
    [-IsSnapshot <Boolean[]>]
    [-HealthStatus <HealthStatus[]>]
    [-StorageSubSystem <CimInstance>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

Description

The Get-VirtualDisk cmdlet returns a list of VirtualDisk objects, across all storage pools, across all providers, or optionally a filtered subset based on provided criteria.

Examples

EXAMPLE 1

PS C:\> Get-VirtualDisk

This example returns all VirtualDisk objects across all visible StoragePool objects, across all visible StorageProvider objects.

EXAMPLE 2

PS C:\> $stpool = (Get-StoragePool -FriendlyName "SpacesPool")
PS C:\> Get-VirtualDisk -StoragePool $stpool

This example lists only the virtual disks from the StoragePool object named SpacesPool.

EXAMPLE 3

PS C:\> Get-VirtualDisk | Where-Object -FilterScript {$_.HealthStatus -Ne "Healthy"}

This example lists all virtual disks, across all pools, and all providers, which are not currently in a healthy state.

EXAMPLE 4

PS C:\> Get-VirtualDisk -FriendlyName "VDisk01" | Get-Disk | Get-Partition | Get-Volume

This example gets the partition and volume associated with a virtual disk. The command gets the virtual disk named VDisk01 and passes the virtual disk to the Get-Disk cmdlet by using the pipeline operator. The Get-Disk cmdlet gets the disk associated with the virtual disk and passes the disk to the Get-Partition by using the pipeline operator. The Get-Partition cmdlet gets the partition associated with the disk, and passes the partition to the Get-Volume cmdlet by using the pipeline operator. The Get-Volume cmdlet gets the volume associated with the partition.

Parameters

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

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

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Disk

Accepts a Disk object as input. The Disk CIM object is exposed by the Get-Disk cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByDisk
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-FriendlyName

Specifies a friendly name for a disk. The friendly name may be defined by a user and is not guaranteed to be unique.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByFriendlyName
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-HealthStatus

Specifies the status of an object and indicates if the object is Healthy or Warning Unhealthy.

Parameter properties

Type:

HealthStatus[]

Default value:None
Accepted values:Healthy, Warning, Unhealthy, Unknown
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InitiatorId

Accepts an InitiatorId object as input. The Initiator ID CIM object is exposed by the Get-InitiatorId cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByInitiatorId
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-InitiatorPort

Accepts an InitiatorPort object as input. The Initiator Port CIM object is exposed by the Get-InitiatorPort cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByInitiatorPort
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-IsSnapshot

Specifies that the virtual disk is a snapshot of another virtual disk.

Parameter properties

Type:

Boolean[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MaskingSet

Accepts a MaskingSet object as input. The Masking Set CIM object is exposed by the Get-MaskingSet cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByMaskingSet
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of an object or setting.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-NoRedundancy

Indicates that this cmdlet gets virtual disks that have one remaining copy of data stored on the physical disk.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPhysicalDisk
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OtherUsageDescription

Specifies the usage of this object.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PhysicalDisk

Accepts a PhysicalDisk object as input. The Physical Disk CIM object is exposed by the Get-PhysicalDisk cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPhysicalDisk
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-PhysicalRangeMax

This parameter is reserved for future use.

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPhysicalDisk
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PhysicalRangeMin

This parameter is reserved for future use.

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPhysicalDisk
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceVirtualDisk

Specifies a virtual disk as a CIMInstance object. The cmdlet gets the snapshot or clone virtual disks that were created from the virtual disk that you specify. To obtain a virtual disk object, use the Get-VirtualDisk cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

BySourceVirtualDisk
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageJob

Specifies an outstanding storage job as a CIMInstance object. The cmdlet gets the virtual disks associated with the storage jobs that you specify. To obtain a virtual disk object, use the Get-StorageJob cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByStorageJob
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageNode

Specifies a storage node as a CIMInstance object. The cmdlet gets the virtual disks that belong to the storage node that you specify. The virtual disks that belong to the storage node have read/write permissions on the node. To obtain a virtual disk object, use the Get-StorageNode cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByStorageNode
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-StoragePool

Accepts a StoragePool object as input. The Storage Pool CIM object is exposed by the Get-StoragePool cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByStoragePool
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageSubSystem

Accepts a StorageSubsystem object as input. The Storage Subsystem CIM object is exposed by the Get-StorageSubsystem cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByStorageSubSystem
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageTier

Specifies a storage tier as a CIMInstance object. The cmdlet gets the virtual disks included in the storage tier that you specify. To obtain a virtual disk object, use the Get-StorageTier cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByStorageTier
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetPort

Accepts a TargetPort object as input. The Target Port CIM object is exposed by the Get-TargetPort cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByTargetPort
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetVirtualDisk

Specifies a virtual disk as a CIMInstance object. The cmdlet gets the virtual disk from which the snapshot or clone virtual disk that you specify were created. To obtain a virtual disk object, use the Get-VirtualDisk cmdlet.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByTargetVirtualDisk
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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 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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UniqueId

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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Id

Parameter sets

ByUniqueId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Usage

Indicates the intended usage of the virtual disk.

Parameter properties

Type:

Usage[]

Default value:None
Accepted values:Unknown, Other, Unrestricted, ReservedForComputerSystem, ReservedForReplicationServices, ReservedForMigrationServices, LocalReplicaSource, RemoteReplicaSource, LocalReplicaTarget, RemoteReplicaTarget, LocalReplicaSourceOrTarget, RemoteReplicaSourceOrTarget, DeltaReplicaTarget, ElementComponent, ReservedAsPoolContributer, CompositeVolumeMember, CompositeVirtualDiskMember, ReservedForSparing
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

CimInstance

You can use the pipeline operator to pass an MSFT_Disk object to the Disk parameter.

CimInstance

You can use the pipeline operator to pass an MSFT_InitiatorId object to the InitiatorId parameter.

CimInstance

You can use the pipeline operator to pass an MSFT_InitiatorPort object to the InitiatorPort parameter.

CimInstance

You can use the pipeline operator to pass an MSFT_MaskingSet object to the MaskingSet parameter.

CimInstance

You can use the pipeline operator to pass an MSFT_PhysicalDisk object to the PhysicalDisk parameter.

CimInstance

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.

CimInstance

You can use the pipeline operator to pass an MSFT_StorageSubsystem object to the StorageSubsystem parameter.

CimInstance

You can use the pipeline operator to pass an MSFT_StorageTier object to the StorageTier parameter.

CimInstance

You can use the pipeline operator to pass an MSFT_TargetPort object to the TargetPort parameter.

CimInstance

You can use the pipeline operator to pass an MSFT_TargetVirtualDisk object to the TargetVirtualDisk parameter.

Outputs

CimInstance

This cmdlet outputs an object that represents the specified virtual disk. For more information about output object type, see MSFT_VirtualDisk class.

Notes

  • When used in Failover Cluster, cmdlets from the Storage module operate on cluster level (all servers in the cluster).