未安装Windows PowerShell的SQL Server提供程序 [英] SQL Server Provider for Windows PowerShell is not installed

查看:369
本文介绍了未安装Windows PowerShell的SQL Server提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure VM上具有Windows Server 2016和SQL Server 2016

我正在运行需要SQL Server模块的Powershell脚本.每当我运行powershell脚本时,都会出现以下错误:

未安装Windows PowerShell的SQL Server提供程序"

我尝试过

安装模块SQLServer -AllowClobber

更新模块sqlserver

导入模块sqlserver

每次运行都没有错误,但是在运行脚本时找不到模块.

PSModulePath如下:

%SystemRoot%\ system32 \ WindowsPowerShell \ v1.0 \ Modules \

C:\ Program Files(x86)\ Microsoft SQL Server \ 130 \ Tools \ PowerShell \ Modules \

C:\ Program Files \ Microsoft监视代理\ Agent \ PowerShell \

C:\ Program Files \ WindowsPowerShell \ Modules

解决方案

打开PowerShell =>以管理员身份运行

要安装SqlServer模块: 安装模块-名称SqlServer

查看已安装模块的版本: 获取模块SqlServer -ListAvailable

新模块已安装到%ProgramFiles%\ WindowsPowerShell \ Modules \ SqlServer 文件夹.

有关详细信息,请参阅"

--------------- -------------------------------------------------- ------------------------------

如果此答案有帮助,请单击标记为答案"或向上" -投票".要提供有关您的论坛体验的其他反馈,请单击 在这里 >

I have Windows Server 2016 and SQL Server 2016 on an Azure VM

I am running a Powershell script that requires the SQL Server module. Whenever I run the powershell script, I get the following error:

"SQL Server Provider for Windows PowerShell is not installed"

I've tried 

install-module SQLServer -AllowClobber

update-module sqlserver

import-module sqlserver

Each runs with no error yet the module is not found when the script is run.

The PSModulePath is as follows:

%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\

C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\

C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell\

C:\Program Files\WindowsPowerShell\Modules

Any help with be greatly appreciated. I am at a stand still

Regards,

Dave

解决方案

To install Sql Server provider on Windows Server 2016, you may follow below steps:

Open PowerShell => Run as administrator

To install the SqlServer module: Install-Module -Name SqlServer

To view the versions of the module installed: Get-Module SqlServer -ListAvailable

The new module is installed to %ProgramFiles%\WindowsPowerShell\Modules\SqlServer folder. 

For more details, refer "Install SQL Server PowerShell module".

-----------------------------------------------------------------------------------------------

If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here


这篇关于未安装Windows PowerShell的SQL Server提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆