Skip to content
A set of PowerShell tools for working with Hyper-V from a Windows 10 desktop.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
docs
en-us
functions
tests
PSHyperVTools.psd1
PSHyperVTools.psm1
README.md
changelog.md
hyperv-vm.extensions.json
license.txt
mygroupvm.format.ps1xml
vmIPAddress.format.ps1xml
vmMemorySummary.format.ps1xml

README.md

PSHyperVTools

PSGallery Version PSGallery Downloads

A set of PowerShell tools for working with Hyper-V from a Windows 10 desktop. You must have the Hyper-V PowerShell module installed. This module is under active development

Installation

You can install the current release from the PowerShell Gallery:

Install-Module PSHyperVTools [-scope currentuser]

Please post any questions, problems, suggestions or comments in the Issues section of this repository.

Commands

Many of the commands in this module are "wrapper" or proxy variations of native Hyper-V cmdlets that are designed to be easier to use in an interactive PowerShell session.

Expand-VMGroup

When using VM groups, such as with Get-VMGroup, the resulting object displays nested VM or Management collections. But often, the whole point of a group is to make it easier to work with the collected virtual machines. This command will expand all virtual machines in a given group. You can also return a simple list of the virtual machine names.

Find-VMGroup

This command is very similar to Get-VMGroup and is not much more than a "wrapper" function for that command. The primary difference is that you can use this command to limit groups to a specific type. Although the default is to find all VM groups.

Get-VMIPAddress

This command is designed to get the IPv4 address for a given set of Hyper-V virtual machines. It assumes a single network adapter in each virtual machine with a single IPv4 address. The command has not been tested with other networking configurations such as NIC teaming.

Get-VMMemorySummary

This command gets memory settings for a given Hyper-V virtual machine.

Get-VMState

One of the drawbacks to the Get-VM command in the Hyper-V module is that it provides no filtering mechanism on the state, such as running. If you often find yourself running Get-VM and piping to Where-Object to only get running or stopped virtual machines, this command will simplify that process. The default behavior is to display all running virtual machines.

Open-VMConnect

This is a PowerShell command to make it easier to connect to a virtual machine console using the VMConnect.exe command line tool. You must run this under an account that has admin rights on the remote Hyper-V host.

Open-VMRemoteDesktop

Connect to a given virtual machine using a remote desktop connection. This assumes a Windows operating system on the virtual machine and it has been configured to allow remote desktop connections. The connection is made via the virtual machine's IP address. If connecting to a virtual machine on a remote computer it must have a publicly accessible IP address and interface.

Start-VMGroup

This command will expand virtual machine members of a VM group and start the virtual machine if it is not already running.

Stop-VMGroup

This command will expand virtual machine members of a VM group and stop the virtual machine if it running.

Custom Type Extensions

When you import the module, it will also extend the type for a Hyper-V virtual machine and add these script properties. Some of these properties need values from the Hyper-V host. For better performance a PSSession to the Hyper-V host will be created and re-used. You might want to remove any PSSessions in your console before exiting PowerShell if you use this module.

  • ManagementGroups
  • Age
  • TestVHD
  • ConfigurationFile
  • DiskPath
  • Running
  • SizeGB
  • MemoryMB
  • MemoryDemandMB
  • HasSnapshot
  • IPAddress
  • Runtime
  • VMSwitch

Virtual Machine Type Extensions

Last updated 2019-06-04 16:19:53Z

You can’t perform that action at this time.