Slashdot Mirror


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.

7 of 400 comments (clear)

  1. Re:How does it compare? by FictionPimp · · Score: 3, Informative

    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.

  2. Re:Q and A Time: What can Powershell do... by MightyMartian · · Score: 3, Informative

    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.
  3. Re:How much spyware is in it? by Anonymous Coward · · Score: 2, Informative

    The dotnet core dev tools have telemetry built in and you are automatically opted-in. It can be turned off, but in typical MS fashion they slid it past everyone hoping it wouldn't be noticed. It's perfectly rational to suppose that the PS port has telemetry reporting features in it. I would assume it does and so should everyone else.

  4. Re: Heu.. ???? by MightyMartian · · Score: 4, Informative

    Having administered Exchange from Exchange 97 to Exchange 2010, I can confirm that it's a pretty shaky system and can throw up some huge gotchas on occasion. It's also a bloated nightmare. I'm not sure if there's an upper limit to the resources that Exchange would gobble up.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  5. Re:Heu.. ???? by chispito · · Score: 5, Informative

    And objects, big fucking deal. I've been using Bourne variants for a quarter of a century and never thought "Boy, I wish I had classes".

    You never wished for an object-oriented shell because you are already proficient in Unix shells, and it is clear you have only ever tried to make PS fit the Unix paradigm.

    What I particularly dislike is how it automatically filters output, and you have to use arguments or other applets to give you fuller output.

    Only the view in the console window is filtered by default. If you send the pipeline to a csv or xml, you'll get everything. It filters the console view because there is far more and more complex data being send along. It is not Unix, the pipeline is not compose of flat lines of text.

    --
    The Daddy casts sleep on the Baby. The Baby resists!
  6. Re:who wants it? by Bobfrankly1 · · Score: 4, Informative

    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.

  7. Re:It's not what I call a scripting language. by Gadget_Guy · · Score: 3, Informative

    Wow, that's elegant.

    Actually, depending on what was being piped, it could be simplified to:

    cat file.txt | where PropertyName -match "regex"

    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:

    cat file.txt | where Length -gt 80

    Of course, if you use the scriptblock version with the { } characters, then you can do complicated expressions

    # Find long lines that start with the word using
    cat file.txt | where { $_.Length -gt 80 -and $_ -match '^using" }

    # Find large files
    dir | where Length -gt 1mb

    # Find large files that were written within the last week (not optimised)
    dir | where { $_.Length -gt 1mb -and $_.LastWriteTime -gt (get-date).AddDays(-7) }

    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:

    $html = invoke-webrequest http://slashdot.org/
    $html.Links | where InnerText -eq 'Privacy'