Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with PowerShell SQL Server Modules

Posted on 2016-10-27
9
Medium Priority
?
691 Views
Last Modified: 2016-10-28
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).
0
Comment
Question by:dbbishop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 71

Expert Comment

by:Qlemo
ID: 41862488
Where is the modul file located in fact? You can always provide the full path to make sure it is found.
0
 
LVL 15

Author Comment

by:dbbishop
ID: 41862580
C:\Program Files\Microsoft SQL Server\110\Tools\PowerShell\Modules\SQLPS\
$env:PSModulePath has that location in the path.
0
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 41862765
A wrong path in PSModulePath can stop PS from searching. Try by directly providing the path when importing
import-module 'C:\Program Files\Microsoft SQL Server\110\Tools\PowerShell\Modules\SQLPS\sqlps.psd1' -verbose

Open in new window

0
Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

 
LVL 15

Author Comment

by:dbbishop
ID: 41862812
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).
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 41862826
You wrote import-module sqls - is that a typo in the question?
0
 
LVL 15

Author Comment

by:dbbishop
ID: 41862830
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..." )
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 41862858
Using bold and stuff helps to make that obvious :p.
0
 
LVL 15

Author Comment

by:dbbishop
ID: 41863805
Just out of curiosity, I edited the PSModulePath environment variable to have just the one path (C:\Program Files\Microsoft SQL Server\110\Tools\PowerShell\Modules\SQLPS) and still get the error, so not sure what the "underlying" problem is.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 41863853
Test with Get-Module -ListAvailable and the original env var if there are modules found at all.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question