powershell open sourced live

Microsoft released some great news yesterday (18/08/2016): PowerShell is now Open sourced, and available on Linux AND MacOSx (!!!).

Yeah, amazing isn’t it??!!

Everybody talks about powershell linux; blogs, youtube channels, twitter accounts etc..

I tried to summarize the most important annoncements, guides, blog posts and various examples in this single blog post, so that finding the right information to start with powershell linux and/or deploying and using PowerShell Linux or on Mac OSx is easy.

I will try to update this post regularly to add any new resources that help us to start using powershell linux or MAC OSx, so be sure to check this article regularly.

What has exactly been said in the last few days concerning this HUGE step that Microsoft made in Open sourcing PowerShell, and making powershell available on linux?
What does it actually means for us, PowerShell users / developpers? What does it mean for the hardcore Linux users?

What will work on powershell linux? What does not work (yet) on powershell linux? Where should we start to use powershell linux? How do we install powershell linux? Where can we go to get the latest information about powershell linux? I’ll cover most of these points here by pointing the big annoncement on the different blog posts of the different microsoft teams involved. Some cool videos to get you started, and an interesting interview on the Scripting Podcast with Jeffrey Snover that will answer all the open questions you have.

Annoncements

Powershell linux

Microsoft released some great news yesterday (18/08/2016) at linux con: PowerShell is now OpenSourced, and available on officially availble and supported on Linux AND MacOSx (!!!).

That is really big big news. But what does that actually means? How do I get powershell linux it on my linux box? Does powershell linux work just as on Windows?

First things first. See here the real part when the Microsoft PowerShell Team opened sourced the PowerShell code officially on the github

Every team member has to confirm the change before the final push. Pretty cool ! 🙂

This opens then the door for a new area of PowerShell: powershell linux, and powershell on Mac OSx

The Powershell team communicated officially on their blog, what open sourcing PowerShell (making it availble powershell linux and on MAC OSx) actually means. I really recommend you read their article availble here.

Jeffrey Snover him self (The creator of PowerShell) explains on this MVA video what this actually means, and gives us some insights on the first steps to launch PowerShell on Windows, to make it interact with perl etc..

This is a very interesting video that show you some use cases powershell linux, and is also a good starting point for linux admins who want to have a global overview of what powershell is, and what it brings to the linux platform.

After this MVA recording, Jeffrey Snover was the Guest on the PowerScripting PodCast Channel where he answered the questions from the community.

He answers the difficulties they faced, the new processes that had to be set up etc…

What does this NOT mean?

There is this very interesting article from Wim Coekaerts who works for the Cloud and Datacenter division on everything that is open sourced.

Wim explains that Powershell is not intended to be a replacement for Bash, but it gives simply the possilibity to manage Windows machines from a Mac OSx or a linux box using the tools that you are familiar with. This article is pretty short, and is denitly worth the read.

.NET Core framework is not the .NET framework

Everybody knows that PowerShell is build on top of the .NET framework. Powershell on linux, mac OSx and nano server are all based on a adapted version of the .NET framework called .NET Core. Learn more about .NET core right here.

These two version are identicall, but not equivalent. The younger version of the .NET frame work (.NET Core) does not have the same potential of his older borther. Things that you would expect in the regular .NET framework on a Windows machine might simply not be needed on a linux box (e.g everything that has to do with the registry management is not availble on Linux) or doesn’t even make sense to port over to linux (The windows presentation framework (WPF) for example). This means that not all the functionality you are used to use on your Windows box will be available on a linux or MAC OSx box.  So, existing scripts with GUI’s that handle registry settings will defenitly not work.

knowing that the .NET core framework narrows down the existing scope of possibilities of powershell, what DOES work then?

Well, on my first tests on the MAC OSx of my girl friend (yeah yeah yeah…) it shows that we have access to 345 cmdlets. But be aware, that some of them are actually shipped in this alpha version, but not working (such as the event cmdlets). Other ones have already reported to have some bugs, such as the ‘select-xml‘ cmdlet.

Other big topics such as JEA and Client side remoting are also not availble (yet).

What DOES work tough, are PowerShell Functions, PowerShell Classes (yay o/), configurations, working with things like the file system, processes (Services not quite yet). There is no PowerShell ISE (since it is based on WPF) but visual studio code is availble on linux, and PowerShell editor services are availble on Sublime and Visual studio code. It is planned to be available on VI / VIM in the near future.

I recommend you read through the complete list of known issues that is avaible here.

What has exactly been open sourced in powershell?

According to Jeffrey Snovers interview in the Scripting podcast, the following things are open sourced:

  1. Powershell Core
  2. WinRM
  3. OMI
  4. The PowerShell Cmdlets then self.

WMI is by this meaning not open sourced. (OMI will be the WMI equivalent for Linux and OSx operating systems).

Only cmdlets written by the PowerShell team have been open sourced. This means that cmdlets from other products such as Exchange, or ConfiMgr etc..are not managed by the Powershell Team..This means that these cmdlets could or could not be open sourced one day. It will depend on the internal process of each team.

I will update this section if we get more information on that part.

What does not work, and what are the know issues in powershell on linux?

There is a list of known issues availble on the powershell github page right here.

For know, the existing cmdlets availble on linux, with the known list of issues are the following ones (extracted table from here)

Commands Operational State Notes
Get-Service New-Service Restart-Service Resume-Service Set-Service Start-Service Stop-Service Suspend-Service Not available. These commands will not be recognized. This will be fixed in a future release.
Get-Acl, Set-Acl Not available. These commands will not be recognized. This will be fixed in a future release.
Get-AuthenticodeSignature, Set-AuthenticodeSignature Not available. These commands will not be recognized. This will be fixed in a future release.
Wait-Process Available, doesn’t work properly. For example Start-Process gvim -PassThru | Wait-Process doesn’t work; it fails to wait for the process.
Update-Help Available but doesn’t work. CabinetExtractorFactory generates an InvalidOperation exception. These will be fixed in a future release.
Register-PSSessionConfiguration, Unregister-PSSessionConfiguration, Get-PSSessionConfiguration Available but doesn’t work. Writes an error message indicating that the commands are not working. These will be fixed in a future release.
Get-Event, New-Event, Register-EngineEvent, Register-WmiEvent, Remove-Event, Unregister-Event Available but no event sources are available. The PowerShell eventing commands are present but most of the event sources used with the commands (such as System.Timers.Timer) are not available on Linux making the commands useless in the Alpha release.
Set-ExecutionPolicy Available but doesn’t work. Returns a message saying not supported on this platform. Execution policy is a user-focused “safety belt” that helps prevent the user from making expensive mistakes. It is not a security boundary.
Select-Xml Available but doesn’t work. The underlying Select.Xml.Node classes are missing on Linux/.NET Core. This is unlikely to be fixed in the near term so this cmdlet will be probably be removed.
New-PSSession, New-PSSessionOption, New-PSTransportOption Available but New-PSSession doesn’t work. New-PSSessionOption and New-PSTransportOption do work but are useless without New-PSSession. The underlying client remoting layer code for WSMan is missing. This will be fixed soon in a future release.
Start-Job, Get-Job, Receive-Job, Remove-Job, Stop-Job, Wait-Job The background job cmdlets are available and work with the important exception of Start-Job. Without the ability to start a background job, the other cmdlets are useless. This will be fixed soon in a future release.

More powershell linux cmdlets might not work as expected. New issues can be reported here, if they are not already listed here.

How do I get started?

Get started with powershell on linux

If you are curious about how to make things work on linux, I recommend you go and read Bartek Bielowski and Ben Gelens article on the PowerShell Magazine over here.

It will guide you through the overall process to get you started whit the alpha version of PowerShell, and highlight some important things of what you can and can’t do in PowerShell on Linux.

Get started with Powershell on Max OSx

If you want to get started installing PowerShell Mac OSx, I recommend you have a look a this very good article from June Blender ‘setting up powershell for your mac

I also have an article in my pipe, so stay tunned 😉

I want to contribute to the open source powershell project, how can I help?

Now that PowerShell has been opened sourced, you can access all the code directly from the official repository on github right here.

But before you begin, be sure to read the right documentation first!

You want to report a bug?

You have encountered an odd behaviour that you think is a bug. Read the list of known issues here, it might already be a known issue and the PowerShell team is already working on it to provide a fix.

The issue you are facing is not yet listed on github and want to create an a new issue to have your problem fixed?

To create a new issue on github, you have to use the following form.

Contributing to the code:

If you want to contribute to add a cool new feature, be sure to read the contribution guide available here.

Contributing to the documentation:

To contribute to the existing documentation, be sure to read this official guide before you do so.

How do I keep track with all these fast changes?

One of the most difficult thing in this new area with the New Microsoft, is to be able to keep track of all the changes. In this new cloud area, everything is changing super fastly, and keeping up with the latest and the greatest can be a hasel. It is important to get the information on the right place. I’ll recommend you subscribe to the following twitter accounts, and consult these web pages regularly.

Important twitter handles and webpages:

The powershell Team: @powershell_team
Jeffrey Snover: @jsnover
The PowerShell community web page: http://www.powershell.org
PowerShell Github page: https://github.com/PowerShell/
PowerShell Gitter page: Gitter Page
Slack PowerShell Channel: https://powershell.slack.com/

If you have suggestion of links to add, don’t hesitate to let me know by commenting this webpage, or by contacting me on twitter at @stephanevg

I will update this page as often as possible, so forget to bookmark this page as well!