When trying to perform Hyper-V export of an agent, you may received an error:
"Cannot execute an export task." The term "Get-VM" is not a recognized as the name of a cmdlet, function script file, or operable program
Logs may show:
VirtualMachineExporterBase (Export Volume Images VM Location)
Attach failed with exception
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Error message: The term 'Get-VM' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
Solution 1:
Please add the optional Hyper-V powershell module as follows:
# Install-WindowsFeature -name Hyper-V -IncludeManagementTools
Solution 2:
If the above solution does not work, please complete the following:
1. Stop Core Service gracefully, see: How To Stop or restart the Core Service (4034348) (quest.com)
2. Repair Hyper-V role with all management tools included
3. Repair AppAssure Core software.
Solution 3:
1. Open Server Manager
2. Click Manage | Add Roles and Features
3. Click Next until you reach Features
4. Scroll down to Remote Server Administrator Tools and expand this option
5. Expand Role Administration Tools
6. Select Hyper-V Module for Windows Powershell
7. Click Next until you reach the confirmation to install. The installation of this feature will not require a reboot of the server.