The term ‘Get-VM’ is not recognized as the name of a cmdlet
Recently while trying to execute Get-VM command, I got the above error message
the complete error message is
Get-VM : 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.
At line:3 char:1
- CategoryInfo : ObjectNotFound: (Get-VM:String) , CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
To fix this error you need to follow the below steps.
Import the Hyper-V module
After executing the above command i got the below error
The error is
import-module : The specified module ‘Hyper-V’ was not loaded because no valid module file was found in any module directory.
To fix this error, You need to to follow the below steps
Open the control panel –>Programs –> Program and features –> Turn Windows features on or off
Check the Hyper-V modules like below and click on the OK button,
This will search for the files and will apply the changes.
Now the changes have been added successfully. It will ask to restart, click on the Restart now button to finish the installation.
Note: Unless and until you restart the system the changes will not affected. So click on the Restart now button to restart.
Now to verify the modules are installed properly, Go to the below path and see if the Hyper-V module is present there now.
Now if you will try to execute the below command, It will not throw any error
You may like following Azure tutorial:
In this tutorial, we discussed how to fix the error, The term ‘Get-VM’ is not recognized as the name of a cmdlet. I hope it helped you to fix your issue.