SimplySql icon indicating copy to clipboard operation
SimplySql copied to clipboard

SimplySql 1.8.0+PowerShell Core 7.2.0+Ubuntu: Module cmdlets not recognized by default via install-module -name simplysql

Open penalvch-zz opened this issue 2 years ago • 2 comments

Summary

I'd like to report an issue encountered with SimplySql 1.8.0 and PowerShell Core 7.2.0 on Ubuntu that caused me quite a few hours of confusion until I found a workaround.

What is expected to happen?

What is expected is if one installs the simplysql module via PowerShell Core in Ubuntu, it works out of the box, as if one had run the commands in Windows.

From a fresh Ubuntu install do: $ sudo snap install powershell --classic powershell 7.2.0 from Microsoft PowerShell✓ installed $ pwsh PS /> install-module -name SimplySql

What happens instead?

PS /> show-sqlconnection show-sqlconnection: The term 'show-sqlconnection' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Is there a workaround?

PS /> $test1=(get-installedmodule -name simplysql) PS /> $test2=(get-command | where-object {$_.Source -eq 'SimplySql'}) PS /> if($test1.count -eq 1 -and $test2.count -lt 21){import-module simplysql}

penalvch-zz avatar Nov 21 '21 21:11 penalvch-zz

@penalvch -- I'm not surprised that there is an issue. SimplySql was originally built prior to PowerShell Core existing and has not been updated and tested to run on cross-platforms. I've done minimal testing of SimplySql on PowerShell 7 (Windows), and not had an issue -- but that was peremptory testing.

I have been exploring an major update to SimplySql that would be fully cross-platform compatible, but I do not have an ETA on this.

mithrandyr avatar Nov 21 '21 21:11 mithrandyr

@mithrandyr -- Thanks for replying so quickly!

I piloted this module with Ubuntu, PSC, and MariaDB, with the intent to use from Windows or Linux. Given the workaround, seems like a go.

However, while I haven't tested with other databases, or used all the cmdlets, I've not encountered any other issues so far. At least linux folks can reliably use the module in the mean time. Thanks for making this!

lsb_release -rd Description: Ubuntu 21.10 Release: 21.10

apt-cache policy mariadb-server mariadb-server: Installed: 1:10.5.12-1build1 Candidate: 1:10.5.12-1build1 Version table: *** 1:10.5.12-1build1 500 500 http://us.archive.ubuntu.com/ubuntu impish/universe amd64 Packages 500 http://us.archive.ubuntu.com/ubuntu impish/universe i386 Packages 100 /var/lib/dpkg/status

penalvch-zz avatar Nov 22 '21 02:11 penalvch-zz