D B
asked on
Problem with PowerShell SQL Server Modules
I am blue in the face and EXTREMELY frustrated. I have spent two days trying to implement sqlps SQL Server extensions on one of our server. I have followed the instructions at http://guidestomicrosoft.com/2015/01/13/install-sql-server-powershell-module-sqlps/. I have checked dozens of websites and am not having any luck. When I try to execute import-module sqls I get the 'standard' error message:
"import-module : The specified module 'sqlps' was not loaded because no valid module file was found in any module directory."
There has to be something strange in my environment because I have checked everything that I've come across on the internet that it is suggested I check. Any help in resolving this would be greatly appreciated.
This is a production SQL Server environment running Windows Server 2008 R2 Standard, SP1 (64-bit) and SQL Server 2012 SP1 (also 64-bit).
"import-module : The specified module 'sqlps' was not loaded because no valid module file was found in any module directory."
There has to be something strange in my environment because I have checked everything that I've come across on the internet that it is suggested I check. Any help in resolving this would be greatly appreciated.
This is a production SQL Server environment running Windows Server 2008 R2 Standard, SP1 (64-bit) and SQL Server 2012 SP1 (also 64-bit).
Where is the modul file located in fact? You can always provide the full path to make sure it is found.
ASKER
C:\Program Files\Microsoft SQL Server\110\Tools\PowerShel l\Modules\ SQLPS\
$env:PSModulePath has that location in the path.
$env:PSModulePath has that location in the path.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
well, I have to admit that this is both joyous and perplexing. Joyous because it works. Perplexing because all the directories in the path are valid. The 'bad' part of it is that I am going to have to put in a switch statement because some of our servers have SQL Server installed on the D drive and some on the C drive (don't ask why).
You wrote import-module sqls - is that a typo in the question?
ASKER
Yes it was a typo in the question, verified by the error message, which I cut-and-pasted ("The specified module 'sqlps' was not loaded..." )
Using bold and stuff helps to make that obvious :p.
ASKER
Just out of curiosity, I edited the PSModulePath environment variable to have just the one path (C:\Program Files\Microsoft SQL Server\110\Tools\PowerShel l\Modules\ SQLPS) and still get the error, so not sure what the "underlying" problem is.
Test with Get-Module -ListAvailable and the original env var if there are modules found at all.