Microsoft PowerShell Goes Open Source and Lands On Linux and Mac (pcworld.com)
Microsoft announced on Thursday that it is open sourcing PowerShell, its system administration, scripting, and configuration management tool that has been a default part of Windows for several years. The company says it will soon release PowerShell on Mac and Linux platforms. PCWorld reports: The company is also releasing alpha versions of PowerShell for Linux (specifically Ubuntu, Centos and Redhat) and Mac OS X. A new PowerShell GitHub page gives people the ability to download binaries of the software, as well as access to the app's source code. PowerShell on Linux and Mac will let people who have already built proficiency with Microsoft's scripting language take those skills and bring them to new platforms. Meanwhile, people who are used to working on those platforms will have access to a new and very powerful tool for getting work done. It's part of Microsoft's ongoing moves to open up products that the company has previously kept locked to platforms that it owned. The company's open sourcing of its .NET programming frameworks in 2014 paved the way for this launch, by making the building blocks of PowerShell available on Linux and OS X. By making PowerShell available on Linux, Microsoft has taken the skills of Windows administrators who are already used to the software, and made them more marketable. It has also made it possible for hardcore Linux users to get access to an additional set of tools that they can use to manage a variety of systems.
Embrace, extend and extinguish ???
Link:
https://en.wikipedia.org/wiki/...
Everything I write is lies, read between the lines.
Solutions to problems no one except windows admins are having. I don't think I'll lose much sleep.
Nope -- they only ruin Lunix. The BSDs are doing fine.
CLI paste? paste.pr0.tips!
Powershell can be really powerful. Everything is a object and it allows you to easily write your own cmdlets and modules to extend the shell. No more parsing the text output of one command to create input to another. It's really very slick.
I use Powershell extensively to deploy applications using Microsoft SCCM at work. I use Linux the rest of the time. Bash scripting is very suitable to the way *nix commands work. Powershell is very suitable to scripting in Windows. I find PS very easy to learn and to work in, but only because I was already familiar with concepts like the pipeline (from Linux) and objects (from python ;-). I can create a PS script to install and configure an application quickly and easily because, just as in Linux there are commands that do everything you need to do, in PS there are cmdlets that allow you to easily (for the most part) access the various subsystems of Windows.
I see PS as a greatly improved, much easier way of doing what I used to struggle to do with vbscript or, a long time ago, with batch files.
Every once in a while I get told to run something under cmd.exe or PowerShell, and am reminded how incredibly limited these apps are when compared with any *nix *sh terminal app. Why does anyone think Linux users would take PowerShell over bash?
For many, working with an object-oriented terminal is immensely more preferable to having to wrangle text.
The reason for doing this I thought would have been obvious, but from the comments it doesn't seem so.
No Linux admin, who administers standard Linux bare metal or VMs is going to install this, not in a million years, they've got bash scripts with GNU utils, or they learnt Python or Perl or something else years and years ago, they've no use for PowerShell...
If however, you use Azure (MS *are* the second largest cloud computing provider), and you want to do web scale, Microsoft either needs to start giving out Perl and or Python modules, or they need to get PowerShell on Mac / Linux for people to be able to script their Azure / SQL / Exchange instances so that the admins and devs can integrate with Chef and everything else out there.
With the amount of work that's gone into Powershell for it to be an admins platform, it's *easier* to port Powershell to Linux than what it is to rebuild powershell for Python or Perl or whatever else.
Curiosity was framed; ignorance killed the cat. -- Author unknown
I think this is simple a smart move. You don't really have Linux admins saying, "Man, I wish I had Powershell!" as much as you have Windows admins saying, "I spent all this time making Powershell scripts. I wish I could run the same scripts on Linux." They're servicing their own users, and providing extra value in learning to use Microsoft technology.
This is the sort of thing that I used to think Microsoft was stupid for not doing.
agreed. Coming from Solaris to Windows, I find it horrid, just horrid. Some days, I would give my server for a workable "grep".
pipe to: where {$_.property -match "regex"}
Powershell has had a workable grep for a long time, but it's usually learning how objects work that typically obstruct new users.
Wow, that's elegant.
Sheesh, evil *and* a jerk. -- Jade
Ever heard of awk and sed? I've been doing complex manipulations of data using tools like this for most of my IT career. Christ, I used awk to transform weird variant field exports from a mainframe to CSV to be imported into an inventory system while the most complex shell language Microsoft offered was the MS-DOS 6 command.com.
Honestly I think some of the people bragging up Powershell never really used *nix at all, at least not in any sophisticated way.
The world's burning. Moped Jesus spotted on I50. Details at 11.
Except Cygwin is even more bloated and slow than Powershell. I did actually work a lot with it about ten years ago, to the point where I even got a radius daemon compiled, but it was arduous and Cygwin can be a bit flaky. But really, the biggest problem is that it's slow.
The world's burning. Moped Jesus spotted on I50. Details at 11.
... For many ...
You keep using that word. I do not think it means what you think it means.
(best read in a pseudo-Spanish accent)
#DeleteChrome
ok seriously, does anyone else know of any shell that not only needs an entire framework install but also has 44MB of shit in it's source code?
Well, you need to understand that unix-based versions of powershell are actually being implemented through emacs.
#DeleteChrome
But with bash you can just start typing text. No need to look up obscure command system and object names if they only thing you want to do is get a list of all files matching a pattern. There's no text wrangling, you just start typing commands. And the same syntax you use for giving commands is used if you want a complicated script.
The difference is that Unix is oriented around commands and programs that take input and give output; whereas Windows is oriented around DLLs and frameworks that build on top of DLLs.
So dealing with those DLLs from a scripting language is very powerful, but those are inherently complex operations. The learning curve is like a brick wall. Unix builds on combining very simple operations into more complex results. If you only use powershell twice a year you'll forever be stumped and lost, but if you use bash only twice a year you'll still be able to get stuff done.
As someone who uses bash twice a month (red hat and ubuntu), finding some of the commands, or the correct syntax/switches frequently tends to be a frustrating experience. The man pages are occasionally helpful, but they're just as often a novel on something that's inapplicable, and missing the data I really need. That means a trip to google, and ending up on a blog page.
When I compare that to the documentation in powershell, man seems like an empty water bottle, and powershell's Get-Help is a river. I can Get-Help -examples to skip directly to syntax examples, and I'm moved on to the next step before I've gotten half-way through a man document that *may* or may-not help me. Also, the naming of commands in powershell is *predictable* which is a *huge* help. Get-Command Get-* will return all the available commands for retrieving information, and Set- * for setting whichever.
You can typically *guess* what a command does, just by looking at it. How frequently can you say the same for linux?
Learning *either* can be like a brick wall, depending on what that person has already learned, but I see powershell's documentation and the obviousness of it's command names lends itself to faster learning, including among a couple of linux admins I taught a little powershell to. They still prefer the bash terminal, but I see the fluency of their powershell scripts jumping when they use it every few months.
Wow, that's elegant.
Actually, depending on what was being piped, it could be simplified to:
But where the elegance lies is that the similar code would work for other conditions, beyond what grep could do. If you wanted to find all the long lines in a file, you would say:
Of course, if you use the scriptblock version with the { } characters, then you can do complicated expressions
This so-called non-elegant grep replacement can be used anytime you want to filter something. It doesn't have to be the contents of files or files themselves. Here I download the Slashdot.org homepage and find the link to the privacy statement:
I want to run Powershell commands within a bash shell and be able to pipe their output to Unix utils, and I want to be able to run Unix utils in Powershell and pipe their output to Powershell commands.
I want to be able to mix and match them somehow.
Mostly, I think, the Powershell commands would be most useful paired with a bash shell and Unix utils, at least how I end up needing/wanting to use Powershell most of them time -- which I freely admit is biased by much more experience at a Bash prompt than a Powershell one, and mostly using Powershell commands to generate some kind of output that I want to work with Bash-style.
I recognize that merging them would be complex in some ways, as many Powershell commands return objects not output and the shell is just doing basic formatting of the object as textual output.
But maybe there could be some kind of hydbrid mode pipe operator that would just do the basic console output it would normally do, but send it to an instance of a Bash environment, or some way to access Powershell cmdlets from within bash as if they were normal programs that provided output.