Few questions related to the "State" of the VM:
1) Get-VM has a bunch of properties, one of them being the "State" property which gives the running state of the VM I guess. I have seen various values for State - Off, Running, Saved, OffCritical, RunningCritical. I have a use-case wherein I have to return something based on this state, so I need to know all possible values of the State. I was trying to find it online but didn't find anything. Would be great if someone can let me know all possible values of the "State" property.
2) Also there is a gwmi query which retrieves the VM information - Msvm_ComputerSystem. In the output of that query, there is a EnabledState field, which returns various values related to the state of the VM. I wanted to know how different it is from the"State" returned by Get-VM. Can they be used interchangeable? I have observed that when the "State" from Get-VM is OffCritical, the "EnabledState" from the gwmi query is "Off".
3) Also, what is the difference from the value obtained from Get-VM and gwmi Msvm_ComputerSystem?
Thanks for your help in advance!
3) Also, what is the difference from the value obtained from Get-VM and gwmi Msvm_ComputerSystem?
3) Also, what is the difference from the value obtained from Get-VM and gwmi Msvm_ComputerSystem?