VMware Cloud Community
mondorescue
Contributor
Contributor

reading vm powerstate

Hi together,

i have a virtual machine that is "Powered On". This powerstate i wanna read by a vma perl script.

i tried the following:

$vmstate = $_->runtime->powerState;

As output i get

VirtualMachinePowerState=HASH(0x2022b520)

what i did wrong?

Best regards
Timm
0 Kudos
1 Reply
mondorescue
Contributor
Contributor

shame on me Smiley Happy

i have forgotten ->val

$vmstate = $_->runtime->powerState->val;

Thanks

0 Kudos