Symptoms
After manually importing the Sharegate Powershell module using the Import-Module command, an error message indicating that the method was not found for the command is shown when attempting to execute a Sharegate command. The following picture illustrates this behaviour:
Error Code
Not applicable.
Details
In order to execute Powershell commands from the Sharegate module, the module must first be imported. However, starting with Sharegate 5.12, the ,.NET framework version 4.6 is required to execute Sharegate and its associated commands.
When importing the module manually, the .NET framework version 4.6 cannot be validated unlike other versions. Therefore, if it has not been installed on the computer running the commands, the module will be imported, but unable to run properly.
Solution
- Make sure that you are using an existing command from the Sharegate module, the full list of commands is available here.
- Make sure that the .NET Framework 4.6 version is installed on your computer. You can verify this by opening any Sharegate 5.12 or higher executable. If it is not installed, a prompt indicating that this version of the framework is needed will be shown.
- Make sure that the module was imported correctly. Either start the Shell window from Sharegate or by running the Sharegate Shell executable.