Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've tried re-installing SQL Server 2014 and I'm still getting the following error message when trying to import-module sqlps. The same registry key exists but is appended with 120. I'm able to use commands like Invoke-SqlCmd. Not sure what the issue is here. Any help appreciated.

OS: Windows 7 Enterprise Version 6.1 Build 7601:Service Pack 1.

SQL Server: SQL Server 2014 Development Edition.

In x86 window:

PS H:> import-module sqlps -disablenamechecking Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps' because it does not exist. At C:\Users\russell_johnson\Documents\WindowsPowerShell\Modules\sqlps\sqlps.psm1:26 char:13 + $item = Get-ItemProperty $sqlpsreg + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE...owerShell.sqlps:String) [Get-ItemProperty], ItemNotFo undException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

In 64bit window:

PS H:> import-module sqlps Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps' because it does not exist. At C:\Users\russell_johnson\Documents\WindowsPowerShell\Modules\sqlps\sqlps.psm1:26 char:13 + $item = Get-ItemProperty $sqlpsreg + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE...owerShell.sqlps:String) [Get-ItemProperty], ItemNotFo undException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

WARNING: The names of some imported commands from the module 'sqlps' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb. PS SQLSERVER:>

share|improve this question
    
I e-mailed Michiel Wories who wrote the sqlps module. His suggestion was change to: $sqlpsreg="HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.M‌​anagement.PowerShell.sqlps120" However, but now I get an error: No snap-ins have been registered for Windows PowerShell version 3. I tried registering via processes found on stackoverflow but get an error that the .dll does not exist. I've tried uninstalling and re-installing SQL Server twice. –  Russ960 May 22 at 18:19

1 Answer 1

Does it work if you change $sqlpsreg to HKLM\Software\Wow6432Node\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sql

share|improve this answer
    
How would I change that I don't supply any arguments to the import-module sqlps? –  Russ960 May 21 at 19:12
    
Hmm, you could edit it but there may be an easier way to test what I suspect. Are you on a 64bit computer? Are you using x32 version of PowerShell? –  Adil Hindistan May 21 at 19:25
    
Yes I'm using the x86 window but see the edits above for the error from the x64 window. –  Russ960 May 21 at 19:55
    
Ok, so nothing to do with x32 binary accessing x64reg. Can you edit the psm1 file and change the path to actual value then? –  Adil Hindistan May 21 at 20:56
    
After in x86: Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.P‌​owerShell.sqlps120' because it does not exist. At C:\Users\russell_johnson\Documents\WindowsPowerShell\Modules\sqlps\sqlps.psm1:26 char:13 + $item = Get-ItemProperty $sqlpsreg + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\...rShell.sqlps120:String) [Get-ItemProperty], ItemNotFo undException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand –  Russ960 May 21 at 21:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.