Get-ItemProperty: Não é possível encontrar o caminho 'HKLM: \ SOFTWARE \ Microsoft \ PowerShell \ 1 \ ShellIds \ Microsoft.SqlServer.Management.PowerShell.sqlps'

6

Eu tentei reinstalar o SQL Server 2014 e ainda estou recebendo a seguinte mensagem de erro ao tentar import-module sqlps . A mesma chave de registro existe, mas é anexada com 120. Eu posso usar comandos como Invoke-SqlCmd . Não sei qual é o problema aqui. Qualquer ajuda apreciada.

  • SO: Windows 7 Enterprise Versão 6.1 Build 7601: Service Pack 1.
  • SQL Server: SQL Server 2014 Development Edition.

Na janela x86:

PS H:> import-module sqlps -disablenamechecking
Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\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], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

Na janela x64:

PS H:\> import-module sqlps
Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\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], ItemNotFoundException
+ 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:\>
    
por Russ960 21.05.2014 / 20:18

2 respostas

-1

Funciona se você mudar $ sqlpsreg para HKLM \ Software \ Wow6432Node \ Microsoft \ PowerShell \ 1 \ ShellIds \ Microsoft.SqlServer.Management.PowerShell.sql

    
por 21.05.2014 / 20:36
-2

executando o SQL 2014 script atualizado para HKLM: \ SOFTWARE \ Microsoft \ PowerShell \ 1 \ ShellIds \ Microsoft.SqlServer.Management.PowerShell.sqlps120

para executar conforme o esperado

    
por 21.11.2016 / 16:13