Get-VirtualDisk
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
Parameter Set: ByFriendlyName
Get-VirtualDisk [[-FriendlyName] <String[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByDisk
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-Disk <CimInstance> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByInitiatorId
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-InitiatorId <CimInstance> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByInitiatorPort
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-InitiatorPort <CimInstance> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByMaskingSet
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-MaskingSet <CimInstance> ] [-OtherUsageDescription <String[]> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByName
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-Name <String[]> ] [-OtherUsageDescription <String[]> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByPhysicalDisk
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-PhysicalDisk <CimInstance> ] [-PhysicalRangeMax <UInt64> ] [-PhysicalRangeMin <UInt64> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: BySourceVirtualDisk
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-SourceVirtualDisk <CimInstance> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByStoragePool
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-StoragePool <CimInstance> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByStorageSubSystem
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-StorageSubSystem <CimInstance> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByTargetPort
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-TargetPort <CimInstance> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByTargetVirtualDisk
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-TargetVirtualDisk <CimInstance> ] [-ThrottleLimit <Int32> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Parameter Set: ByUniqueId
Get-VirtualDisk [-AsJob] [-CimSession <CimSession[]> ] [-HealthStatus <HealthStatus[]> ] [-IsSnapshot <Boolean[]> ] [-OtherUsageDescription <String[]> ] [-ThrottleLimit <Int32> ] [-UniqueId <String[]> ] [-Usage <Usage[]> ] [ <CommonParameters>]
Detailed 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.
Parameters
-AsJob
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 |
-Disk<CimInstance>
Accepts a Disk object as input. The Disk CIM object is exposed by the Get-Disk cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-FriendlyName<String[]>
Specifies a friendly name for a disk. The friendly name may be defined by a user and is not guaranteed to be unique.
Aliases |
none |
Required? |
false |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-HealthStatus<HealthStatus[]>
Specifies the status of an object and indicates if the object is Healthy or Warning Unhealthy.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-InitiatorId<CimInstance>
Accepts an InitiatorId object as input. The Initiator ID CIM object is exposed by the Get-InitiatorId cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-InitiatorPort<CimInstance>
Accepts an InitiatorPort object as input. The Initiator Port CIM object is exposed by the Get-InitiatorPort cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-IsSnapshot<Boolean[]>
Specifies that the virtual disk is a snapshot of another virtual disk.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MaskingSet<CimInstance>
Accepts a MaskingSet object as input. The Masking Set CIM object is exposed by the Get-MaskingSet cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-Name<String[]>
Specifies the name of an object or setting.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-OtherUsageDescription<String[]>
Specifies the usage of this object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PhysicalDisk<CimInstance>
Accepts a PhysicalDisk object as input. The Physical Disk CIM object is exposed by the Get-PhysicalDisk cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-PhysicalRangeMax<UInt64>
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PhysicalRangeMin<UInt64>
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SourceVirtualDisk<CimInstance>
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. 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. 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 |
-TargetPort<CimInstance>
Accepts a TargetPort object as input. The Target Port CIM object is exposed by the Get-TargetPort cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-TargetVirtualDisk<CimInstance>
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 |
Id |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Usage<Usage[]>
Indicates the intended usage of the virtual disk.
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_Disk
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_InitiatorId
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_InitiatorPort
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_MaskingSet
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Partition
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_PhysicalDisk
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StoragePool
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_StorageSubsystem
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.Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_TargetPort
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
The output type is the type of the objects that the cmdlet emits.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk
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
This example returns all VirtualDisk objects across all visible StoragePool objects, across all visible StorageProvider objects.
PS C:\> Get-VirtualDisk
EXAMPLE 2
This example lists only the virtual disks from the StoragePool object named SpacesPool.
PS C:\> $stpool = (Get-StoragePool -FriendlyName "SpacesPool")
PS C:\> Get-VirtualDisk -StoragePool $stpool
EXAMPLE 3
This example lists all virtual disks, across all pools, and all providers, which are not currently in a healthy state.
PS C:\> Get-VirtualDisk | Where-Object –FilterScript {$_.HealthStatus -Ne "Healthy"}
EXAMPLE 4
This example gets the virtual disk associated with the partition with drive letter Y.
PS C:\> $part = (Get-Partition -DriveLetter Y)
PS C:\> Get-VirtualDisk -Partition $part