none
SQLPS not available after installation RRS feed

  • Question

  • Hello everyone,

    I have tried looking for a solution to this, but as of yet, been unsuccessful.  Here is what is going on.

    I have a new VM with Windows 2008R2 Enterprise SP1 Installed.  I then install SQL Server 2008R2 Standard Edition with SP3.  After installing these, I restart the computer, and then install the following 3 SQL Server 2012 Feature Pack Objects:

    1) MS CLR Types for SQL Server 2012
    2) MS SQL Server 2012 Shared Management Objects
    3) MS Windows PowerShell Extensions for SQL Server 2012

    It is my understanding that when the above 3 are installed, that the SQLPS module will be available to me outside of SSMS (one of many articles on how to do this is found here:  Install_SQLPS).  However, when I try running a Get-Module -ListAvailable, SQLPS doesn't show up in the list.  I have tried restarting, and it doesn't show up either.  No error are being presented, nothing in the even logs, and installation of each of the above was successful.  Uninstalling and reinstalling doesn't work either.

    Does anyone have any thoughts as to why I am not seeing the SQLPS module?

    Thank you very much for your assistance.

    Sincerely,

    Nathan

    Friday, November 14, 2014 3:24 AM

Answers

  • I figure out the issue.  While all of the above items did work, it didn't allow use to simply do a 

    import-module SQLPS

    The issue was that, somehow, someway, the 2012 version of the feature pack files were replaced with the 2008R2 version.  Recopying the correct files and installing them gives us the SQLPS module as expected.  

    Thank you all for you assistance.

    Sincerely,

    Nathan

    Sunday, November 16, 2014 6:16 PM

All replies

  • It needs to be imported

    Import-Module "SQLPS" -DisableNameChecking

    Friday, November 14, 2014 3:27 AM
  • It needs to be imported

    Import-Module "SQLPS" -DisableNameChecking

    I wish it where that.  When I tried doing it, I get the following:

    Import-Module : The specified module 'sqlps' was not loaded because no valid module file was found in any module
    directory.
    At line:1 char:1
    + Import-Module sqlps -DisableNameChecking
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ResourceUnavailable: (sqlps:String) [Import-Module], FileNotFoundException
        + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

    Friday, November 14, 2014 3:45 AM
  • I looked on a Server 2012 R2 with SQL Server 2012 installed.

    Looked for the SQLPS (note the folder location)

    PS C:\> get-ChildItem SQLPS -Recurse
    
    
        Directory: C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules
    
    
    Mode                LastWriteTime     Length Name
    ----                -------------     ------ ----
    d----          7/6/2014   6:59 PM            SQLPS
    
    
        Directory: C:\Windows\assembly\NativeImages_v2.0.50727_32
    
    
    Mode                LastWriteTime     Length Name
    ----                -------------     ------ ----
    d----          7/6/2014   7:43 PM            SQLPS
    
     

    Then I checked the environment variable that is searched for PS Modules

    PS C:\> $Env:PSModulePath
    C:\Users\Administrator\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\s
    ystem32\WindowsPowerShell\v1.0\Modules\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\
    

    The noted folder is in the search string.

    Does the environment variable has similar results?

    Have you reboot since install for environment variables to take effect?

    Friday, November 14, 2014 4:24 AM
  • Brian,

    When I run $Env:PSModulePath, I get the following:

    C:\Users\ward_nheaivilin\Documents\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\

    When I look in the c:\program files (x86)\Microsoft SQL Server\ I don't have a 110.  Only a 100.  In that directory, I don't have a PowerShell folder under tools.  I also looked in the c:\Program Files\Microsoft SQL Server\ directory, with no luck there either.

    Yes, I have restarted multiple times.

    Nathan

    Friday, November 14, 2014 4:00 PM
  • 100 is SQL Server 2008, the article does not mention installing those utilities with SQL Server 2008.

    Those are SQL Server 2012 client utilities that could be incompatible with the underlying SQL Server 2008 installation. Install them on a workstation without SQL Server installed.

    Or SQL Server 2008 Powershell is 

    "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLPS.exe"

    add-pssnapin sqlserverprovidersnapin100
    add-pssnapin sqlservercmdletsnapin100

     


    Friday, November 14, 2014 11:56 PM
  • The folder and file is here on 2008R2

    dir 'C:\Program Files (x86)\Microsoft SQL server\100\tools\binn\Microsoft.SqlServer.Management.PSProvider.dll'

    It is installed with Management Studio, De sure Management Studio is installed and that PowerShell support is checked.

    If it is installed correctly you can open and prompt CMD or PowerShell and type SQLPS and get the SQLServer: > prompt.


    ¯\_(ツ)_/¯

    Saturday, November 15, 2014 6:01 PM
  • On WS2008R2/SQS2008R2 SQLPS is here:

    dir 'C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\sqlps.exe'

    The values are all from an instance installed by Microsoft engineering.


    ¯\_(ツ)_/¯


    • Edited by jrv Saturday, November 15, 2014 6:04 PM
    Saturday, November 15, 2014 6:03 PM
  • I figure out the issue.  While all of the above items did work, it didn't allow use to simply do a 

    import-module SQLPS

    The issue was that, somehow, someway, the 2012 version of the feature pack files were replaced with the 2008R2 version.  Recopying the correct files and installing them gives us the SQLPS module as expected.  

    Thank you all for you assistance.

    Sincerely,

    Nathan

    Sunday, November 16, 2014 6:16 PM
  • For what it's worth, I had installed SQL 2014 with Client connectivity and management tools installed, and import-module SQLPS wasn't working.  From Brian's suggestion, I looked at $Env:PSModulePath, and wound up only having C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ listed.  SQLPS didn't exist there.

    My solution: Go to environment variables and edit it to include the path to the SQL Modules.

    My path variable then looks like this:

    %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\

    I would guess that an alternative would be to copy the SQLPS folder from C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\ into %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\

    Hope maybe this helps others out there that come across this thread.

    Friday, April 3, 2015 1:24 PM
  • The path to SSQPPSS does belong in $PSModulePath:

    PS C:\scripts> $env:PSModulePath -split ';'
    C:\Users\jvierra\Documents\WindowsPowerShell\Modules
    C:\Program Files\WindowsPowerShell\Modules
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
    c:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\
    C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement
    PS C:\scripts>

    This is where it is set when the tools are installed.


    ¯\_(ツ)_/¯

    Friday, April 3, 2015 3:25 PM