Skip to content

hyper v system state comparison

Featured Replies

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.