The dpmhv-showVMs command returns a list of VMs on a Hyper-V host server. The command gets the names and corresponding GUIDs of the specified VM.
This command has the following format:
dpmhv-showVMs -host hostname[-retval] [-silent]
Specifies the name of the Hyper-V server host.
Returns a value for further processing.
Specifies not to direct the output to the screen.
The dpmhv-showVMs command returns an array of objects representing the VMs on the specified host.
The objects include the following properties:
Represents the unique ID of the VM.
Represents the display name of the VM.
Example: Get all VMs
This example returns a list of VMs and their corresponding GUIDs on the host, "hvserver."
dpmhv-showVMs -host hvserver
Example: Show VM Properties for all VMs
This example returns displays the properties of all VMs on the host, "hvserver."
a = dpmhv-showVMs -host hvserver -retval -silent for each(vm in a) { ? ? "VM:", vm.ElementName dpmhv-getVMProperties -host hvserver -vmid (vm.Name) }
Copyright © 2013 CA. All rights reserved. |
|