Scott Hanselman

Announcing PowerShell on Linux - PowerShell is Open Source!

8月 18, '16 コメント [21] Posted in Open Source | PowerShell
Sponsored By

I started doing PowerShell almost 10 years ago. Check out this video from 2007 of me learning about PowerShell from Jeffrey Snover! I worked in PowerShell for many years and blogged extensively,  ultimately using PowerShell to script the automation and creation of a number of large systems in Retail Online Banks around the world.

Fast forward to today and Microsoft is announcing PowerShell on Linux powered by .NET Core and it's all open source and hosted at http://GitHub.com/PowerShell/PowerShell.

Holy crap PowerShell on Linux

Jeffrey Snover predicted internally in 2014 that PowerShell would eventually be open sourced but it was the advent of .NET Core and getting .NET Core working on multiple Linux distros that kickstarted the process. If you were paying attention it's possible you could have predicted this move yourself. Parts of PowerShell have been showing up as open source:

Get PowerShell everywhere

Ok, but where do you GET IT? http://microsoft.com/powershell is the homepage for PowerShell and everything can be found starting from there.

The PowerShell open source project is at https://github.com/PowerShell/PowerShell and there are alphas for Ubuntu 14.04/16.04, CentOS 7.1, and Mac OS X 10.11.

To be clear, I'm told this is are alpha quality builds as work continues with community support. An official Microsoft-supported "release" will come sometime later.

What's Possible?

This is my opinion and somewhat educated speculation, but it seems to me that they want to make it so you can manage anything from anywhere. Maybe you're a Unix person who has some Windows machines (either local or in Azure) that you need to manage. You can use PowerShell from Linux to do that. Maybe you've got some bash scripts at your company AND some PowerShell scripts. Use them both, interchangeably.

If you know PowerShell, you'll be able to use those skills on Linux as well. If you manage a hybrid environment, PowerShell isn't a replacement for bash but rather another tool in your toolkit. There are lots of shells (not just bash, zsh, but also ruby, python, etc) in the *nix world so PowerShell will be in excellent company.

PowerShell on Windows

Related Links

Be sure to check out the coverage from around the web and lots of blog posts from different perspectives!

Have fun! This open source thing is kind of catching on at Microsoft isn't it?


Sponsor: Do you deploy the same application multiple times for each of your end customers? The team at Octopus have been trying to take the pain out of multi-tenant deployments. Check out their 3.4 beta release.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
2016年8月18日 15:24:49 UTC
you need more coffee scott. 2016-2007 is 9, not 14.
powershell first appeared November 14, 2006; 9 years ago according to wikipedia. https://en.wikipedia.org/wiki/Windows_PowerShell
2016年8月18日 15:26:23 UTC
The link to the github repo is incorrect. It should read github.com/Powershell/Powershell.
Giridaran Manivannan
2016年8月18日 15:31:48 UTC
Jeremy - Oops! Thanks
Gridaran - Fixed!
Scott Hanselman
2016年8月18日 16:09:43 UTC
Its called Bash
Linux user
2016年8月18日 16:18:15 UTC
Wow this is awesome!!
Nmk
2016年8月18日 16:21:20 UTC
Jeremy you need coffee too, please see your signature link.

Scoot, Thanks for posting it down. I am new to linux.
2016年8月18日 16:40:16 UTC
Although this is cool, i'm trying to understand why would anyone use powershell over existing shell utilities.

Maybe for cross compatibility sake ?
2016年8月18日 17:11:29 UTC
@Carlos, I initially thought that until I read the part about managing remote Windows machines.
Fergal
2016年8月18日 17:13:50 UTC
This is kinda stupid. What is the point when I can use standards that already exist on Linux. Powershell is a pain to deal with.
Zachary Burns
2016年8月18日 17:38:21 UTC
Bash on Windows, Powershell on Linux... The next logical step would be to port an open source command.com (from MSDOS 3.2) to iOS. When ?
Stephan
2016年8月18日 17:48:55 UTC
At last a modern automation tool for linux.

It time to depracte unproductive tools as Batch and Bash, those belong in a middle age museum, this is very welcome.
Glkfkn
2016年8月18日 18:09:13 UTC
@Carlos Ferreira, it's useful on DevOps escenarios... specially with the .NET Core stuff.
Andres Iturralde
2016年8月18日 19:09:53 UTC
Powershell in Docker :)

https://hub.docker.com/r/manojlds/powershell/
2016年8月18日 19:15:08 UTC
Thanks great step towards popularity of .net and PS! Hope it will boost plugins/modules development
Artyom K
2016年8月18日 20:05:34 UTC
This is great news! Up until now, cross platform .Net projects, like Dotnet CLI itself, used separate build scripts for Linux and Windows. Now, it will be possible to write one PowerShell script to rule them all. I personally have tons of build/deploy/other DevOps scripts written in PowerShell (and DSC). I would rather gladly test them on Linux and work around the rough edges than rewrite all that stuff in Bash (and maintain two separate versions). If someone thinks of dockerizing his services, the possibility to use the same scripts on Linux and Windows should make the transition much smoother.

But the most important thing here for me is open sourcing Powershell. If Microsoft didn't prepare a version that runs on Linux, someone other geek would probably do it sooner or later (it's worth mentioning that there already exists an open source effort to reimplement Powershell: Pash.
2016年8月18日 20:20:48 UTC
Is this to support SQL Server on linux?
2016年8月18日 20:32:12 UTC
What made you think that Linux users need it? What is so special about it?
2016年8月18日 20:54:46 UTC
Once again this is what I called 'geeks trap theory' Imagine your self writing down some libraries to extend that open sourced version then we suppose that what you authored is valuable as an investment then the question will be who will benefit of the fruits of that effort? Microsoft or that geek?




csharp.geek
2016年8月18日 21:06:02 UTC
@Haafiz PowerShell is very different from traditional shells in that the language treats everything as objects rather than just text. This reduces the need for tools like awk, sed and grep. In most *nix shells, you pipe text from one command to the next. In PowerShell, you are piping rich objects from one command to the next and you only turn the object into text when you need to display it or when you want to save it to a file (of course you could save it as binary data as well). Of course, you don't have to use PowerShell, and many *nix users will happily ignore it, but those of use who are familiar with PowerShell and who work on *nix machines will happily incorporate it into our toolsets.
2016年8月18日 21:10:44 UTC
@csharp.geek As an open source advocate, why would I care who benefits from the fruits of my efforts? I have certainly benefited from a lot of Open Source work that MS has participated in, and I have no problem with them benefiting from some of my work in return.
2016年8月18日 23:47:29 UTC
Is this a good way of using NuGet on OS X? Lots of documentation on NuGet packages seems to assume that you're using Windows and the VS Package Manager Console, so I was looking forward to being able to follow these sorts of examples in a straightforward manner when developing for ASP.Net on OSX (example: adding a package to my project through the command line, like "Install-Package <Package-Name>)

Here's what I did, hoping it would work...
--Installed PowerShell using .pkg installer on OS X
--Opened a terminal and entered "powershel"
--Typed "Install-Package -ListAvailable", which was suggested as something you could do with the Package Manager Console here: https://docs.nuget.org/consume/package-manager-console
--Got this error:
Get-Package : A parameter cannot be found that matches parameter name 'ListAvailable'.

So it looks like the Get-Package command is something that PowerShell recognizes, but it doesn't behave the same way as it does in the VS Package Manager Console?

Is this something I can eventually expect to work? Is there something obvious I'm overlooking about how to make it work?
Andrew Stegmaier
名前
メールアドレス gravatarアイコンを表示)
ホームページ
 
コメント(一部のHTMLは使用可能です:a@href@title, b, blockquote@cite, em, i, li, ol, pre, strike, strong, sub, super, u, ul@はattributeつまり属性を意味します。例えば、<a href="" title=""> or <blockquote cite="Scott">.などを使用することができます。)
コメントのプレビューを同時に表示

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.