Get-SCStorageDisk
Gets a storage disk object for the specified host from the VMM database.
Syntax
NoFilter (Default)
Get-SCStorageDisk
[[-Name] <String>]
[-VMMServer <ServerConnection>]
[<CommonParameters>]
FilterByVMHost
Get-SCStorageDisk
[[-Name] <String>]
-VMHost <Host>
[<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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 0 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | Host |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FilterByVMHost
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMMServer
Specifies a VMM server object.
Parameter properties
Type: | ServerConnection |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
NoFilter
Position: | Named |
Mandatory: | False |
Value from pipeline: | True |
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.
Outputs
StorageDisk
This cmdlet returns a StorageDisk object.