How to fix a Hyper-V backup that fails with the error: Hyper-V PowerShell Module is not installed.
Hyper-V backup fails because Powershell is not properly installed on a Hyper-V 2008 R2 server.
Configure Windows PowerShell on Hyper-V 2008 R2 server. (For Windows 2008 R2, this procedure requires that the Hyper-V role is enabled.) After completing this procedure, the system will be ready for Hyper-V scripting.
- Install Windows PowerShell on the Hyper-V Windows 2008 R2 server. You can do this from the Server Manager or by using the ServerManagerCmd.exe command-line tool:
ServerManagerCmd.exe –install PowerShell
- Configure Windows PowerShell to allow the use of scripts. This is disabled by default. To configure this, issue this command from PowerShell:
Additional documentation is available on CodePlex at http://pshyperv.codeplex.com/
- Download and install the Windows PowerShell Hyper-V module from http://pshyperv.codeplex.com/releases. You need this module to access all the cmdlets designed specifically for Windows PowerShell on Hyper-V 2008 R2.
From the CodePlex PowerShell Management Library for Hyper-V page, download the latest stable, non-development release. Make sure the “block” attribute is removed from the zipped files before you install them. This will execute setup scripts without needing digital signatures.
If you’re doing the install on Server Core or doing a manual install, unblock and unzip the module file into some temp directory or on another computer before copying the setup files to the Hyper-V server.
- Issue this command to install the module you downloaded:
copy *.* %ProgramFiles%\modules\HyperV
- From an elevated Windows PowerShell command prompt (run as administrator) on the Hyper-V server, add the Import-Module to the Windows PowerShell profile file using this command:
If you get an error message, verify that you didn’t miss Step 1, installing Windows PowerShell.
- Import the module using this command:
This will let you use the cmdlets without having to configure the server each time.
- Verify you’ve successfully installed the cmdlets and that they are functioning properly by issuing the Get-Command cmdlet to see a list of the commands available to you:
Get-Command –Module Hyperv
As with other modules, each cmdlet comes with helpful information about its functions and examples on how to use it:
Get-Help New-VM –Detailed
Get-Help New-VM –Examples
The backup fails due to a missing PowerShell Management Library for Hyper-V from http://pshyperv.codeplex.com/releases.
For more detailed information on backup failures and performance issues see Unitrends KB 5062 - Backup Failures and Performance Issues