rmuhammadali Posted April 21, 2018 Report post Posted April 21, 2018 Hi Everyone, I need help to compare my hyper v virtual machine state either its running or off. Please help me out in this. $status = (get-vm -ComputerName server1 -name "testmachine1" | select-object state) if ($status -eq "Running") {"equal"} else {"nequal"} i am new to powershell and done the above script, which is not working. Regards Ali Quote Share this post Link to post Share on other sites More sharing options...
Hi Everyone,
I need help to compare my hyper v virtual machine state either its running or off.
Please help me out in this.
$status = (get-vm -ComputerName server1 -name "testmachine1" | select-object state)
if ($status -eq "Running") {"equal"} else {"nequal"}
i am new to powershell and done the above script, which is not working.
Regards
Ali
Share this post
Link to post
Share on other sites