It can be very frustrating when your professor says one thing about PowerShell and various websites seem to offer solid proof to the contrary. Does PowerShell actually work on non-Windows systems or not? Today’s SuperUser Q&A post has the answer to a puzzled reader’s question.

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

The Question

SuperUser reader FredSavage187 wants to know if PowerShell works on other operating systems besides Windows:

Does PowerShell work on other operating systems besides Windows?

PowerShell is open sourced and is available on Linux [Microsoft Azure Blog]

PowerShell Repository [GitHub]

Which one is actually correct? Does PowerShell work on Linux and Mac OS as well as Windows?

The Answer

SuperUser contributor Ben N has the answer for us:

Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

As you learned at the PowerShell repository on GitHub, quite a few operating systems and distributions are supported. For example, here are the instructions for Ubuntu and a demonstration:

One could argue that not all of PowerShell is available in non-Windows environments since some features depend on libraries found only in Windows. The ParsedHtml property on the HtmlWebResponseObject type returned by Invoke-WebRequest, for example, is only useful on Windows because it holds a COM object that comes from an unmanaged library, mshtml.dll to be specific. On other platforms, there is nothing there. And, of course, there are cmdlets to manage systems found only in Windows, like Modern apps (Get-AppxPackage, for example).

Still though, the PowerShell infrastructure works perfectly well on other operating systems, plenty of the cmdlets are usable anywhere, and support is only getting better.

Image Credits: Jeff Hicks (Petri IT Knowledgebase)