Using a pre-existing library of Windows PowerShell functions that you can use directly from the shell can make management much simpler. Fortunately, some Microsoft employees have worked together to develop a sample Windows PowerShell Hyper-V Management Library. You can
download the PowerShell Management Library for Hyper-V R2 from Microsoft’s open source project site.
The library, which currently includes 80 functions, allows you to manage a variety of components, including:
- Virtual machine configuration and state
- Virtual hard disks
- Virtual floppy disks
- Virtual CD/DVD images
- Virtual network adapters
- Virtual network switches
- Snapshots
In addition, the library has a series of helper functions that help optimize code reuse and maintain a consistent interaction with the functions.