I can see a value of properties, but I can't get the value

I'm trying to access the threshold values for alarm

$alarmDef = get-AlarmDefinition "Datastore use."

$alarmDef.extensiondata.expression.expression.

results in:

Operator: isAbove
Type: Datastore
Metric: VMware.Vim.PerfMetricId
Yellow: 8500
YellowInterval:
Red: 9000
RedInterval:
DynamicType:
DynamicProperty:

So I can see the yellow (8500) and Red (9000) values from above. so, I'm going

$alarmDef.extensiondata.expression.expression.yellow

but she returns nothing?

The correct path is

$alarmDef.extensiondata.Info.expression.expression

but I guess that it was just a typo.

The Expression property points to an array, even if there is only 1 expression, you will have to use an index.

Like this

$alarmDef.extensiondata.Info.expression.expression [0]. Yellow

Tags: VMware

Similar Questions

Maybe you are looking for