I loaded Powershell on my Ubuntu Linux 16.04 VM according to Microsoft's instructions on github. That went very smoothly. I didn't even get the errors they warned about. (I think it's because I already have SQL Server installed on the VM)
Once the installation was complete I typed 'powershell' at the command line and ...boom.. it worked.
So far so good.
Next I uploaded my script to the Linux box and 'Linux-ized' it.
I added the following command to the first line of the file with nano. (Nano is an easy to use linux editor. To open a file with it, type nano filename )
This is how linux knows what interpreter to run your script with. (Rather than using the file extension that Windows uses.)
I also changed the authentication to sql server authentication from trusted, and added a valid username and password in the "Configuration" section of the script
Then I Saved the file. (CTRL-X Y <ENTER>)
I also changed the file permissions so that it was executable.
chmod 744 runSQLcmd.ps1
Then came the moment of truth....
The good news, the script ran, it connected to database, and the help command worked.
The bad news, the the DataTable object that I use to output data isn't part of the Linux powershell port. I'm going to have figure out another option.
Overall Powershell for Linux works the way I would expect a Linux shell to work. But, I am a bit disappointed that its missing some core libraries.