We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db57147 commit 6a87de4Copy full SHA for 6a87de4
extensions/HyperV/hyperv.py
@@ -200,12 +200,11 @@ def reboot(self):
200
def status(self):
201
command = f'(Get-VM -Name "{self.data["vmname"]}").State'
202
state = self.run_ps(command)
203
- if state.lower() == "running":
+ power_state = "unknown"
204
+ if state.strip().lower() == "running":
205
power_state = "poweron"
- elif state.lower() == "off":
206
+ elif state.strip().lower() == "off":
207
power_state = "poweroff"
- else:
208
- power_state = "unknown"
209
succeed({"status": "success", "power_state": power_state})
210
211
def delete(self):
0 commit comments