Get-SCVirtualHardDisk
Get-SCVirtualHardDisk
Gets virtual hard disk objects.
構文
Parameter Set: All
Get-SCVirtualHardDisk [-All] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: EquivalentResourceParamSet
Get-SCVirtualHardDisk -FamilyName <String> [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-Release <String> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: ID
Get-SCVirtualHardDisk [-ID <Guid]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: NameParamSet
Get-SCVirtualHardDisk -Name <String> [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: Template
Get-SCVirtualHardDisk -VMTemplate <Template> [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: VM
Get-SCVirtualHardDisk -VM <VM> [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
詳細説明
The Get-SCVirtualHardDisk cmdlet gets virtual hard disk objects from a virtual machine, from a template, or as a standalone file stored in the Virtual Machine Manager (VMM) library.
A virtual hard disk can be a Windows-based .vhd file, a Citrix XenServer-based .vhd file, or a VMware-based.vmdk file. A virtual hard disk might be stored as a standalone object in the VMM library, attached to a virtual disk drive on a template, or attached to a virtual disk drive on a deployed or stored virtual machine.
パラメーター
-All
Indicates that this cmdlet retrieves a full list of all subordinate objects independent of the parent object. For example, the command Get-SCVirtualDiskDrive -All
retrieves all virtual disk drive objects regardless of the virtual machine object or template object that each virtual disk drive object is associated with.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-FamilyName<String>
Specifies a family name for a physical resource in the VMM library. This value is used in conjunction with the Release, Namespace, and Type parameters to establish equivalency among library resources.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-ID<Guid]>
Specifies the numerical identifier as a globally unique identifier (GUID) for a specific object.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Name<String>
Specifies the name of a VMM object.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-OnBehalfOfUser<System.String>
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Release<String>
Specifies a string that describes the release of a library resource. VMM automatically creates a release value for every resource imported into the library. After the resource has been imported, the string can be customized.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VM<VM>
Specifies a virtual machine object.
エイリアス |
none |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-VMMServer<ServerConnection>
Specifies a VMM server object.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-VMTemplate<Template>
Specifies a VMM template object used to create virtual machines.
エイリアス |
Template |
必須? |
true |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- VirtualHardDisk
注
- This cmdlet requires a VMM virtual machine object or a VMM template object, which can be retrieved by using the Get-SCVirtualMachine cmdlet, or the Get-SCVMTemplate cmdlet, respectively.
例
Example 1: Get a virtual hard disk object from the library
This command gets the virtual hard disk object named VHD01.vhd stored on LibraryServer01, and then stores the object in the $VHD variable.
PS C:\> $VHD = Get-SCVirtualHardDisk -VMMServer "VMMServer01.Contoso.com" | where { $_.Name -eq "VHD01.vhd" -and $_.LibraryServer.Name -eq "LibraryServer01.Contoso.com" }
Example 2: Get a virtual hard disk object from a virtual machine
The first command connects to VMMServer01.
The second command gets the virtual machine object named VM01, selects all virtual hard disks on VM01 whose name includes the string DataDisk, and then stores the returned virtual hard disk objects in the $VHD variable.
PS C:\> Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com"
PS C:\> $VHD = Get-SCVirtualMachine -Name "VM01" | Get-SCVirtualHardDisk | where { $_.Name -match "DataDisk" }
Example 3: Get a virtual hard disk object from a specific template
This command gets the template object named Template01 from the library, and then displays all virtual hard disk objects on that template.
PS C:\> Get-SCVMTemplate -VMMServer "VMMServer01.Contoso.com" | where {$_.Name -eq "Template01"} | Get-SCVirtualHardDisk