PoSh on Ubuntu

I heard about the PowerShell announcement recently where the platform is porting over to Linux and OSX. I think this is part of the SQL Server on Linux project, where I assume we’ll start to see the functionality that we have on Windows appear on Linux platforms. OSX is a surprise, but since more and more people run Macs, this makes sense. Hopefully we’ll see SQL Server Developer on OSX at some point.

I’ve got an Ubuntu VM, so I decided to see how well this works, so I picked the Ubuntu 16.04 package and found the instructions I ran on my VM. You can see how this worked in the image below.

2016-08-18 12_37_14-Ubuntu 64-bit SQL Server - VMware Workstation

Now that I’ve got the package downloaded, I can start PowerShell pretty simply:

2016-08-18 12_38_51-Ubuntu 64-bit SQL Server - VMware Workstation

What can I do? Well, let me grab a short PoSh script I have. This is from the Advent of Code, and it’s a .ps1 for me. Here it is interactively.

2016-08-18 12_49_53-Ubuntu 64-bit SQL Server - VMware Workstation

If I make a .PS1, then I can paste in the original code:

2016-08-18 12_51_09-Ubuntu 64-bit SQL Server - VMware Workstation

and if I execute this:

2016-08-19 11_07_01-Ubuntu 64-bit SQL Server - VMware Workstation

That’s pretty cool.

I haven’t explorer the extent of the PoSh support, and I don’t think there is SQL Server support yet for the SMO namespaces, but I’m sure it’s coming.

If you’re a Linux person, or an OSX person, I’d encourage you to play a bit and see what you think of the port.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , . Bookmark the permalink.

1 Response to PoSh on Ubuntu

  1. Pingback: PoSh Everywhere | Voice of the DBA

Comments are closed.