Search code examples
sql-serverpowershellpowershell-4.0powershell-moduledbatools

how to install a Powershell module in Powershell 4?


I have some machines on Powershell 4

enter image description here

In these machines even after I have placed the new powershell modules within the module path they don't show up in the Modules drop down list - as above.

when I do the same thing in machines that are on Powershell 5 I can see the new modules in the Modules drop down list as below.

enter image description here

what else I have to do in order to make the new modules show up in the modules drop down on Powershell 4?


Solution

  • Following the link provided by Larnu in the comments

    After I found the powershell module file .psm1 and run the following command:

    import-Module  "C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.141\dbatools.psm1"
    

    enter image description here