VMware Cloud Community
dmeyner22
Enthusiast
Enthusiast
Jump to solution

script to get powerstate and toolstatus

I'm created a script and I'm having trouble getting the Powerstate it spits out nothing, if I take away Get-View I can get the powerstate.

Excuse my ignorance but I'm just starting to dive into powershell

get-cluster -Name <clustername> | Get-VM | Get-View | Select-Object @{Name="Hostname";e={$_.Name}}, @{Name="VMware Tools"; e={$_.Guest.ToolsStatus}}, @{Name="Powerstate";e={$_.PowerState}}

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

That should be $_.Runtime.PowerState


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

That should be $_.Runtime.PowerState


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
dmeyner22
Enthusiast
Enthusiast
Jump to solution

Thank you!

0 Kudos