适用于Linux的Powershell核心sqlserver模块中缺少Invoke-Sqlcmd cmlet [英] Invoke-Sqlcmd cmlet missing in Powershell core sqlserver module for linux

查看:141
本文介绍了适用于Linux的Powershell核心sqlserver模块中缺少Invoke-Sqlcmd cmlet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Linux Ubuntu 16.04上使用Powershell核心的最新版本.我正在尝试使用Powershell的invoke-sqlcmd cmdlet查询sql服务器数据库. (是的,我已经安装了sqlserver模块) 我收到一条错误消息,提示它找不到该cmdlet.当我安装sqlserver模块时,该命令在Windows powershell中存在. 相同的屏幕截图

I am using latest version of Powershell core on Linux Ubuntu 16.04. I am trying to query a sql server database using powershell's invoke-sqlcmd cmdlet. (Yes I have installed the sqlserver module) I get an error which says that it cannot find the cmdlet. The command is there in windows powershell when I install the sqlserver module. Screenshot of the same

invoke-sqlcmd仅在Windows上有效吗?如果是的话,还有另一种方法可以使我在Powershell内核中获得相同的结果.

Does invoke-sqlcmd only work on Windows? If yes,is there another way I can achieve the same result in powershell core.

推荐答案

使用Powershell核心(在撰写本文时为6.2.3),您可以像这样安装sql server模块:

With Powershell core (6.2.3 at the time of this writing), you can install the sql server module like so:

Install-Module -Name SqlServer

,然后您可以拨打invoke-sqlcmd

如果您想进一步了解它:

If you want to know more about it: http://sqlvariant.com/2019/03/invoke-sqlcmd-is-now-available-cross-platform-in-the-sqlserver-module/

这篇关于适用于Linux的Powershell核心sqlserver模块中缺少Invoke-Sqlcmd cmlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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