Invoke-Sqlcmd cmlet missing in Powershell core sqlserver module for linux

Viewed 1896

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

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

2 Answers

In PowerShell Core, the sqlserver module doesn't export any of the Invoke-* cmdlets. However, there are the Read-SQLTableData and Read-SQLViewData cmdlets that appear to work in a similar fashion if you've already created views on the server side.

Related