Get-XenHostMetricsProperty
Gets a property of a HostMetrics object.
Syntax
Get-XenHostMetricsProperty [-HostMetrics] <Host_metrics>
-XenProperty {Uuid | MemoryTotal | MemoryFree | Live | LastUpdated | OtherConfig}
[-BestEffort] [-SessionOpaqueRef <string>] [<CommonParameters>]
Get-XenHostMetricsProperty [-Ref] <XenRef[Host_metrics]>
-XenProperty {Uuid | MemoryTotal | MemoryFree | Live | LastUpdated | OtherConfig}
[-BestEffort] [-SessionOpaqueRef <string>] [<CommonParameters>]
Description
Gets a specified property of a HostMetrics object. Use the -XenProperty parameter to select which property to retrieve.
Uuid: Get the uuid field of the given host\_metrics.
MemoryTotal: Get the memory/total field of the given host\_metrics.
MemoryFree: Get the memory/free field of the given host\_metrics. (Removed.)
Live: Get the live field of the given host\_metrics.
LastUpdated: Get the last\_updated field of the given host\_metrics.
OtherConfig: Get the other\_config field of the given host\_metrics.
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 |
-HostMetrics
The HostMetrics object to operate on.
| Attribute | Value |
|---|---|
| Type | Host_metrics |
| Required | True |
| Position | 0 |
| Accepts pipeline input | True (ByValue) |
-Ref
The HostMetrics object to operate on, specified by its opaque reference.
| Attribute | Value |
|---|---|
| Type | XenRef[Host_metrics] |
| 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 | XenHostMetricsProperty |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | Uuid, MemoryTotal, MemoryFree, Live, LastUpdated, OtherConfig |
Inputs
-
Host_metrics -
XenRef[Host_metrics]
Outputs
-
System.Object
Examples
Example 1: Get the MemoryTotal property
PS> Get-XenHostMetrics -Uuid 1871ac51-ce6b-efc3-7fd0-28bc65aa39ff | Get-XenHostMetricsProperty -XenProperty MemoryTotal
Gets the MemoryTotal property of a HostMetrics.
Example 2: Get the MemoryFree property
PS> Get-XenHostMetrics -Uuid 1871ac51-ce6b-efc3-7fd0-28bc65aa39ff | Get-XenHostMetricsProperty -XenProperty MemoryFree
Gets the MemoryFree property of a HostMetrics.
Example 3: Get the Live property
PS> Get-XenHostMetrics -Uuid 1871ac51-ce6b-efc3-7fd0-28bc65aa39ff | Get-XenHostMetricsProperty -XenProperty Live
Gets the Live property of a HostMetrics.
Related links
-
Class: HostMetrics
-
Using the XenServer PowerShell module