Funciona se você mudar $ sqlpsreg para HKLM \ Software \ Wow6432Node \ Microsoft \ PowerShell \ 1 \ ShellIds \ Microsoft.SqlServer.Management.PowerShell.sql
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.
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:\>
Funciona se você mudar $ sqlpsreg para HKLM \ Software \ Wow6432Node \ Microsoft \ PowerShell \ 1 \ ShellIds \ Microsoft.SqlServer.Management.PowerShell.sql
executando o SQL 2014 script atualizado para HKLM: \ SOFTWARE \ Microsoft \ PowerShell \ 1 \ ShellIds \ Microsoft.SqlServer.Management.PowerShell.sqlps120
para executar conforme o esperado
Tags powershell sql-server