SQLSERVER module missing cmdlets RRS feed

  • Question

  • I seem to have broken my PS somehow. When I import the SQLSERVER (version 21.0.17262) module, there are only 3 commands:

    • Alias      Decode-SqlName
    • Alias      Encode-SqlName
    • Function  SQLSERVER:  

    I have uninstalled, reinstalled, updated, etc the module a number of times. I also reinstalled Management Studio, just to be sure. I am running PS version 5.1.16299.521 on Windows 10 Enterprise (10.0.16299).

    Any ideas on how to get the rest of the module to load?

    Wednesday, June 6, 2018 1:17 AM

All replies

  • Import-Module SQLServer -Force
    Get-Command -Module SQLServer


    Wednesday, June 6, 2018 1:25 AM
  • Same results.

    PS C:\WINDOWS\system32> Import-Module SQLServer -Force
    PS C:\WINDOWS\system32> Get-Command -Module SQLServer
    CommandType     Name                                               Version    Source
    -----------     ----                                               -------    ------
    Alias           Decode-SqlName                                     21.0.17262 SQLServer
    Alias           Encode-SqlName                                     21.0.17262 SQLServer
    Function        SQLSERVER:                                         21.0.17262 SQLServer

    • Edited by Ben_Tempe Wednesday, June 6, 2018 2:55 AM
    Wednesday, June 6, 2018 2:54 AM
  • You need to reset your system and stat over.


    Wednesday, June 6, 2018 2:56 AM
  • How do I "reset"?

    Wednesday, June 6, 2018 2:57 AM
  • Depends on what version of Windows you are using.


    Wednesday, June 6, 2018 3:05 AM
  • An entire system reset? I'm not doing that to fix PowerShell. I'll stand up a VM expressly for the purposes of using PS if it really comes down to a corrupt install.
    Wednesday, June 6, 2018 3:10 AM

  • Well the only alternative is to hire a trained tech to troubleshoot and fix your system.  Be sure you get someone who is experienced and certified.  Techs are hard to find and most today are not really trained in Windows or in troubleshooting.


    Wednesday, June 6, 2018 3:16 AM
  • I'm getting the exact same symptom an Win 10 machine after upgrade to 1903.

    Uninstalling and reinstalling varii versions of module SQL server did not fix anything.

    @ben_temp how did you end up fixing your issue ? I'd very much like to avoid reinstalling windows if possible.

    Thursday, June 20, 2019 9:54 PM
  • Install-Module SQLServer

    run from elevated prompt.  This will install the latest version of the module in the correct place.


    Thursday, June 20, 2019 10:00 PM
  • Install-Module SQLServer

    run from elevated prompt.  This will install the latest version of the module in the correct place.


    Did that. Uninstalled and reinstalled sqlserver module more than once last night.

    Tried several versions of the module too ( 21.0.17279 and 21.1.18121 )

    Despite all this, get-command will only return the 3 commands like the OP 

    Friday, June 21, 2019 7:13 AM
  • Your system has configuration issues.  I suspect that there is another module installed that is the wrong module.

    Do the following:

    Get-Module -List SQLServer


    Friday, June 21, 2019 8:09 AM
  •                               ExportedCommands                                                                 

    ---------- -------    ----                                ----------------                 Script     21.1.18121 SqlServer                           {Add-RoleMember, Add-

    Friday, June 21, 2019 1:15 PM
  • Ok. Now do this:

    Get-Command -Module SQLServer


    Friday, June 21, 2019 1:38 PM
  • PS C:\WINDOWS\system32>  get-command -module sqlserver

    CommandType     Name                                               Version    Source
    -----------     ----                                               -------    ------
    Alias           Decode-SqlName                                     21.1.18121 SQLSERVER
    Alias           Encode-SqlName                                     21.1.18121 SQLSERVER
    Function        SQLSERVER:                                         21.1.18121 SQLSERVER
    Friday, June 21, 2019 6:37 PM
  • You will need to either do a repair on your system or contact MS to report and get help with this failure.

    It is also possible that you endpoint is restricted by policy.  It appears that only CmdLets are being blocked.


    Friday, June 21, 2019 7:03 PM
  • Well, the system is scheduled for reinstall on Monday. 

    I think something went really wrong with the 1903 update, the CMDLets from dbaTools are OK , the only trouble seems to be with SQLServer module. 

    Anyway thanks for trying to help. 

    Friday, June 21, 2019 7:39 PM