Get-SCStorageDisk

Get-SCStorageDisk

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

Syntax

Parameter Set: NoFilter
Get-SCStorageDisk [[-Name] <String> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: FilterByVMHost
Get-SCStorageDisk [[-Name] <String> ] -VMHost <Host> [ <CommonParameters>]

Detailed Description

The Get-SCStorageDisk cmdlet gets one or more storage disk objects for the specified 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.

Parameters

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHost<Host>

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, type Get-Help Add-SCVMHost -detailed. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

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.

Outputs

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

  • StorageDisk

Examples

Example Example 1: Get all hard disk drives on the specified host.

The first command gets the host object named VMHost01, and then stores the object in the $VMHost variable.

The second command gets all hard disk drive objects from the host stored in $VMHost, and then displays information about those objects.

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

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

The first command gets the host object named VMHost02, and then uses the pipeline operator to pass VMHost02 to the Get-SCStorageDisk 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.

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

New-SCVirtualDiskDrive

Mount-SCStorageDisk

Add-SCVMHost

Get-SCVMHost