Get-XenLVHDProperty
Gets a property of an LVHD object.
Syntax
Get-XenLVHDProperty [-LVHD] <LVHD> -XenProperty {Uuid} [-BestEffort]
[-SessionOpaqueRef <string>] [<CommonParameters>]
Get-XenLVHDProperty [-Ref] <XenRef[LVHD]> -XenProperty {Uuid} [-BestEffort]
[-SessionOpaqueRef <string>] [<CommonParameters>]
Description
Gets a specified property of an LVHD object. Use the -XenProperty parameter to select which property to retrieve.
Uuid: Get the uuid field of the given LVHD.
Parameters
-BestEffort
If set, the cmdlet continues processing further objects instead of throwing a terminating error when an operation fails for one object.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-LVHD
The LVHD object to operate on.
| Attribute | Value |
|---|---|
| Type | LVHD |
| Required | True |
| Position | 0 |
| Accepts pipeline input | True (ByValue) |
-Ref
The LVHD object to operate on, specified by its opaque reference.
| Attribute | Value |
|---|---|
| Type | XenRef[LVHD] |
| Required | True |
| Position | 0 |
| Accepts pipeline input | True (ByPropertyName) |
| Aliases | opaque_ref |
-SessionOpaqueRef
The session object on which to run the cmdlet. This overrides the default session and lets you target a specific open XenServer connection.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-XenProperty
Selects which property to use.
| Attribute | Value |
|---|---|
| Type | XenLVHDProperty |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | Uuid |
Inputs
-
LVHD -
XenRef[LVHD]
Outputs
-
System.Object
Examples
Example 1: Get the Uuid property
PS> Get-XenLVHDProperty -XenProperty Uuid -Ref OpaqueRef:f433bf7b-2b0c-5f53-7018-7d195addb3ca
Gets the Uuid property of an LVHD.
Example 2: Run against a particular session
PS> Get-XenLVHDProperty -XenProperty Uuid -Ref OpaqueRef:f433bf7b-2b0c-5f53-7018-7d195addb3ca -SessionOpaqueRef $session.opaque_ref
Every cmdlet takes -SessionOpaqueRef, which runs it against a session opened with Connect-XenServer rather than the default one. It is how a script drives more than one server at a time.
Example 3: Carry on past a failure
PS> Get-XenLVHDProperty -XenProperty Uuid -Ref OpaqueRef:f433bf7b-2b0c-5f53-7018-7d195addb3ca -BestEffort
Every cmdlet takes -BestEffort, which reports a failure as a non-terminating error and moves to the next object rather than stopping the pipeline.
Related links
-
Class: LVHD
-
Using the XenServer PowerShell module