Get-SCStorageDisk

Gets a storage disk object for the specified host from the VMM database.

Syntax

Get-SCStorageDisk [[-Name] <String>] -VMHost <Host> [<CommonParameters>]
Get-SCStorageDisk [[-Name] <String>] [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

The Get-SCStorageDisk cmdlet gets storage disk objects for a host from the Virtual Machine Manager (VMM) database. You can use this cmdlet with the New-SCVirtualDiskDrive cmdlet to attach a pass-through disk on a virtual machine to a physical hard disk on the host on which that virtual machine is deployed.

Examples

Example 1: Get all hard disk drives on a host

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> Get-SCStorageDisk -VMHost $VMHost

The first command gets the host object named VMHost01 by using the Get-SCVMHost cmdlet. The command stores that object in the $VMHost variable.

The second command gets all hard disk drive objects from the host stored in $VMHost.

Example 2: Get a specific hard disk drive on the host by name

PS C:\> $StorageDisk = Get-SCVMHost -ComputerName "VMHost02.Contoso.com" | Get-SCStorageDisk -Name "\\.\PhysicalDrive0"
PS C:\> $StorageDisk

The first command gets the host object named VMHost02, and uses the pipeline operator to pass VMHost02 to the current cmdlet. That cmdlet gets the hard disk drive object named PhysicalDrive0 for the host. The command then stores the hard disk drive object in the $StorageDisk variable.

The second command displays the contents of $StorageDisk.

Parameters

-Name

Specifies the name of a storage disk that this cmdlet gets.

Type:String
Required:False
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMHost

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts. For more information about each type of host, see the Add-SCVMHost cmdlet.

Type:Host
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

StorageDisk

This cmdlet returns a **StorageDisk** object.