Microsoft PowerShell Core For Linux Now Available as a Snap (betanews.com) 154
Canonical announced on Friday that Microsoft's PowerShell Core is now available on Linux platform as a Snap. From a report: If you aren't familiar, a Snap is essentially a packaged version of a program that can be easily installed on many Linux distributions. Many see it as the future of Linux, as it has the potential to reduce fragmentation. "Built on the .NET Framework, PowerShell is an open source task-based command-line shell and scripting language with the goal of being the ubiquitous language for managing hybrid cloud assets. It is designed specifically for system administrators and power-users to rapidly automate the administration of multiple operating systems and the processes related to the applications that run on those operating systems," says Canonical.
Excellent news (Score:5, Funny)
Re:Excellent news (Score:5, Insightful)
Re: (Score:2)
Embrace - They've integrated Bash and X-Windows into MS Windows with they Linux subsystem work in the past couple years.
Extend - Lets take the most god-awful approach to system administration and add it to a simple (mostly) straight-forward shell.
Extinguish - ??? How are they going to snub out 100+ distros and millions (billions?) of lines of open source floating in the ether?
Re: (Score:3)
How are they going to snub out 100+ distros and millions (billions?) of lines of open source floating in the ether?
systemd ;)
Re:FTFY Excellent news (Score:2)
EEE. They want to make Windows a Linux distro
No, MS wants to make Linux a Windows Distro, FTFY
Re: (Score:1, Flamebait)
Object-oriented shell languages are pretty rad, very intuitive, has auto-complete/intellisense built in so that third party editors can take advantage of it, you don't need to know the syntax of sed/awk, and jq-type functionality works for free, supports package management etc. It's somewhere in-between perl and ruby as a shell.
Probably will be largely ignored by the linux community, but by having powershell support in linux, you can take your windows-land scripts and execute them on linux without h
Re: (Score:2)
I mean this stuff only works if you have programs and cmdlets that actually return and operate on such objects. Now, in addition to writing your powershell script, you also have to write wrapper libraries that control the native linux tools to present something that is API compatible with whatever windows api you are trying to use. Anyone who has tried to get a WinForms application running under Mono/Linux can tell you how well this shit is going to work.
Re: (Score:3)
Object-oriented shell languages are pretty rad
Sure, it's like an awkward substitute for a Python script if that floats your boat.
Re:Excellent news (Score:4, Interesting)
Re:Excellent news (Score:5, Insightful)
Most of the advantage of Powershell comes from access to WMI and other core API functions. As an actual shell goes, it's a horrible bloated monstrosity that is the exact opposite of the Unix philosophy. And without a lot of the hooks, or basically some compatibility layer to turn convert Windows API calls into /proc and /etc hooks, one can imagine it will be even slower than it is on Windows, and with limited functionality. And really, the whole philosophy of Powershell, with its OOP nature, comes out of its origins as basically a CLI for .NET. There really isn't anything comparable in the *nix world save perhaps for some of the GUIs out there.
I get it. This is some way to try to attract a wider base to its toolset, and maybe a bit the other way, but I cannot imagine anyone going through the bloat of bringing up a Powershell script when something like bash will be that much faster and far more intuitive for someone steeped in the *nix world.
Powershell and the whole way the Windows ecosystem is evolving makes truer every day that those who do not understand Unix are doomed to reimpliment it badly.
Re: (Score:3)
As an actual shell goes, it's a horrible bloated monstrosity that is the exact opposite of the Unix philosophy.
Ah, good ol' "Do many things, while aspiring to mediocrity, except when I don't feel like it, or on Tuesdays."
Re: (Score:2)
Re: (Score:2)
What do you mean about PowerShell's lack of pipes? The pipeline is PowerShell's biggest claim to fame. It is more powerful than the simplistic pipes of the other *nix shells, but still supports interacting with Linux programs. For example "man ls | grep the" does exactly the same thing in PowerShell as it does in bash.
Re: (Score:2)
out-file : FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr.
Re: (Score:2)
Re: (Score:2)
I call it intuitive. Sure, it you are trying it out after being used to using bash for the last 20 years then you are going to find things perplexing, but then you don't actually find bash intuitive either; you already have more experience in it. No shell is truely intuitive when you are first starting out.
But where PowerShell is intuitive is in its predictability once you know some of it. The long naming scheme is much derided, but is uses a consistent - format so that if you want to do something that you
Re: (Score:2)
Can you use "ls" instead of dir?
Re: (Score:1)
Next the MS sex-bot that has no holes and is adverse to sex. LOL no dilly bar and no roast beef. Not sure what the sex bot will do... But it is a new segment and they are panning on world domination!
Re: (Score:2)
And for no -trivial automation tasks? At some point, if you're go to administer any system, you're going to have to learn how it works, and not just throw some poorly-fitting compatibility layer on top of it so system administrators of one system don't have to put the effort into learning another.
Re: (Score:1)
Windows is on the desktop... Moving to Samba 4.8 and 4.9, no need for MS file and print servers anymore. NASes are going to move that way too or already have. :-)
Re: (Score:1)
No this is only for MS to manage Azure. they should have not doubled down on Windows and just switched Azure to run Linux... If coke on the third floor had to buy coke from the fourth floor they might just put Pepsi in the machines... Microsoft should have been broken up. I bet the OS guys would run MySQL and the MS-SQL guys would run Linux...
Meanwhile when I asked the old GTE about upgrading the GTD-5 switch to support ISDN-BRI they said they could not it was too expensive as the fourth floor would not
Re: (Score:3)
Re: (Score:3)
Powershell is bad enough, but having to run Windows, everytime you need to use it is even worse. And if your job requires you to deploy to the Azure cloud, then I can see a use for this. Although I believe they now have Linux CLI utils for that as well.
Re: (Score:2)
would a use case be made for replacing native, tried and true {tools} for Linux with some POS
Oh, did someone mention SystemD?
Mod me down, that's fine; I'm moving to FreeBSD. Hopefully S*D will stay working long enough while I plan and execute the move. Not on BTRFS ("But it works fine for me") volumes, either.
Re: (Score:2)
I'm moving to FreeBSD.
I have been slowly evaluating the various BSDs also with the the same idea in mind. But there are a few distros that are "fighting the good fight" :), but I fear that is a loosing battle. Beyond all evidence I still hope this windowization of Linux reverses or can be held off. So I want to be prepared if/when I have to move.
I will stick with my distro of choice and hope for the best :) The good news is at least my favorite distro has been successful keeping sane!
Re: (Score:2)
Because IT managers might only know Microsoft PowerShell, and so they will push to use it for the Linux systems under their control.
Re: (Score:1)
Good managers manage and let the technical details get worked out buy the techies. they might ask for details but the bigger goal is to get to a destination, don't micro-manage your techies, they will hate the job/supervisor and find another job...
Re: Excellent news (Score:2)
Easy object based systems like Azure and Windows servers where everything is an object, not a string or text file.
PS is not a POS. It's just different as something like cygwin is not useful to do much on Windows in comparison as a result. This is welcome for DevOps and System Admins who manages multiple systems.
Re: (Score:2)
i think (and hope) the purpose is for admins that have a linux desktop but manage windows servers or use azure cloud.
That's not the gap. (Score:1)
I really NEED a Microsoft Linux distro.
Of course, with all the special Microsoft proprietary extensions.
Microsoft GNome or Microsoft KDE. And obviously a Microsoft Linux Kernel.
Why? (Score:4, Insightful)
- slow
- bloated
- in all likelihood harvesting data behind your back
- trying to replace something which isn't broken (a Linux terminal)
- dependent on
on my machine? {deity_of_choice}, why would I even permit
Re:Why? (Score:4, Insightful)
I know right? It's weird, but It's what happens when Microsoft hires the Gnome mafia.
Re: (Score:1)
Why, oh why, would I install something that is:
- slow
- bloated
- in all likelihood harvesting data behind your back
- trying to replace something which isn't broken (a Linux terminal)
Yeah, we have systemd for all that already...
Re: (Score:2)
Indeed, as a "ubiquitous language for managing hybrid cloud assets", there is, for just one example, ansible, which already does all that, is also cross platform, and has no special dependencies or runtime overhead requirements either on the host or any on the target.
.NET is dangerous to depend on (Score:5, Insightful)
To elaborate on that last point: being dependent on works under the "Microsoft Patent Promise for .NET Libraries and Runtime Components" is considerably dangerous because of the profound limits for software reuse and modification, and because of how limited this "patent promise" is [endsoftpatents.org]. You cannot deal in the "Microsoft Patent Promise for .NET Libraries and Runtime Components" covered software as you can with free software (which is so named because it respects a user's freedoms to run, inspect, share, and modify the software) under, say, the GNU General Public License version 3 (GPLv3). Here are a few highlights from that article:
That's a huge danger, particularly to anyone used to working in free software where merging code between compatibly-licensed programs is the norm. Your interests as a user (regardless of your technical skill or willingness to learn technical skills) is far better served by the GPLv3 (also covered at the aforementioned article). The GPLv3 is simply far more straightforward and clear about your permissions, and the GPLv3 grants you what you need to deal fully in the software respecting your software freedom the whole time.
Re: .NET is dangerous to depend on (Score:2, Interesting)
Microsoft has released and opensourced
NET for Linux time ago [slashdot.org] so your concerns are outdated.
Re: Why? (Score:2)
Hi Devslash0 this is your boss posting.
Are you finished migrating to Azure yet that the CIO wanted? Oh yeah we need a convenient way to DevOps your Linux app for the Windows Systems Admins that they are familiar with that integrated well with Azure and is object based for our needs, not text based which won't work.
Thanks and could you also Dev ops some on premise Windows Servers as well? We know you like Linux and that is fine but make it happen in your Linux scripting environment?
Thanks
Re: (Score:1)
Re: (Score:1)
A few comments above someone mentioned that not even all Powershell scripts run on every version of Windows that includes Powershell...
I still have bash scripts from years ago that still run and if one of them doesn't after an upgrade it's usually a rather simple fix... Now what was that about brittle?
If your text parsing is brittle, you're doing it wrong.
Re: Please explain (Score:2)
How do you ask sed and grep your Azure and Amazon containers on the cloud?
Re: (Score:2)
Run it with systemd (Score:1)
To experience the stability and security you've come to expect from Microsoft Windows!
Re: (Score:2)
Because, of course, there's no way to do remote admin on Linux. Thank fucking god that Microsoft came along to help us all do what we've been doing on *nix systems for fucking decades.
Jesus Christ, do any of you shills even know what's being going on in the *nix world since Windows was a 16-bit kludge running on top of DOS?
Re: i dunno (Score:3)
Explain then how to automate a few tasks on 100 Linux servers some on premise and some in the cloud without having to log into each one?
Since Powershell is object based you can do more with a for each statement for 100 servers and use custom apis to work the magic without an expensive 3rd party tool. You can do a PSremote session if you want too or just use Azure RM or snmp without having to touch each server.
Re: (Score:2)
Plop the scripts into /use/local/bin on the machines in mirror fashion. Tools like ssh can be scripted as well. Come on, this ain't rocket science.
Re: (Score:1)
Explain then how to automate a few tasks on 100 Linux servers some on premise and some in the cloud without having to log into each one?
We've been doing this for the last 20 years. What makes you think we suddenly lost this ability?
See, this is the problem with "techies" who only know windows - they're so ignorant that they can't even recognise their ignorance. We've been automating tasks on 100's of linux servers just fine using Ansible or similar. Hell, you don't even need Ansible. If your servers already have the admin's public keys in authorized_hosts you can pretty much do anything from a script on the admin end.
Since Powershell is object based you can do more with a for each statement for 100 servers and use custom apis to work the magic without an expensive 3rd party tool. You can do a PSremote session if you want too or just use Azure RM or snmp without having to touch each server.
Hello Mr Windows Adm
Re: i dunno (Score:2)
The fact that you have to use a third party tool because bash doesn't even support objects is breathtaking. It's 2018 and times change as do the needs of IT.
I know more than just Windows and I am not saying that Powershell is a gift from the Gods and is the end all be all of scripting. I am just saying people here assume Unix is superior because it just is and the only way is a text file way and that 40 year old technology is the best because it's always been that way.
Init was replaced by SystemD because in
Re: (Score:2)
What do objects have to do with automation?
Re: (Score:2)
Both Amazon, Azure, and Kubernetes all have apis for configuration, deployment, and testing that are object based. I personally think this is why Python is growing in IT. It is folks who find bash too limiting and have to resort to Python to work with these platforms and tools.
PowerShell will help but I am in favor of a new Unix scripting language that can do objects. I have a feeling the same people who flipped over SystemD won't allow that to happen though. But that is another topic.
As you can tell I thin
Re: (Score:1)
Both Amazon, Azure, and Kubernetes all have apis for configuration, deployment, and testing that are object based.
And? They're not exclusively object based you moron. You can (and I do) use ssh+ansible to automate tasks on 100s of machines from a single local desktop.
You were ignorant of the fact that automation on Linux using bash was being done for at least the past two decades using ssh, and thus the reason for your idiotic requirement [slashdot.org] of:
Explain then how to automate a few tasks on 100 Linux servers some on premise and some in the cloud without having to log into each one?
I understand your confusion - windows only got this sort of functionality recent, which is why I welcomed you to 1998.
BTW: The powershell environment still has a long way to go t
Re: i dunno (Score:2)
Let's read from the article "PowerShell Core from Microsoft is now available for Linux as a Snap. Built on the .NET Framework, PowerShell is an open source task-based command-line shell and scripting language with the goal of being the ubiquitous language for managing hybrid cloud assets. It is designed specifically for system administrators and power-users to rapidly automate the administration of multiple operating systems and the processes related to the applications that run on those operating systems.
Re: (Score:2)
Or they could take a few days, learn the *nix toolkit and then not have to invoke a shell that's going to have to load .NET, a bunch of libraries that will themselves have to be wrappers to replicate Win32 calls. It's going to be like Cygwin in reverse, and run just as badly.
Re: (Score:2)
That's not really the point. The underlying APIs are very dissimilar and to replicate the kinds of calls PowerShell uses for automation is going to require some sort of translation layer to convert Linux system calls and the configurable settings in /proc and /etc. It's the inverse of Cygwin. I don't care if the whole thing gets compiled to binaries, there's going to be a hit on performance (and it's not like powershell is any speed demon even in a Windows environment). Those wrapper libraries are going to
Administrating multiple OSes (Score:2)
"...designed specifically for system administrators and power-users to rapidly automate the administration of multiple operating systems..."
Oh you mean like how Windows has always treated dual-booting multiple operating systems? And support for filesystems of different operating systems? And pretty much any honest-to-goodness, not-embrace-and-extinguish support for *anything* other than M$ products on M$ operating systems, *especially* open-source products of any kind?
As I do see this as a positive move for
Re: (Score:1)
If you like M$ PowerShell and want to continue to use it on Linux.. great. YAT - Yet Another Tool. If you don't like it/don't want to use it - then DON'T!
No one is making you use it. No one is even saying that you have to install it.
If I was working as a sysadmin (either Linus or M$) I would think it great to have the same administrative scripting system on multiple platforms. If I was a Linux only shop - meh... no reason to learn something else as Bash is working just fine.
Having used both (BASH and PowerShell) - I can say that they are both tortuous, but in different ways. They are both powerful, but in different ways. And both are products of their times.
Ya kno, similar words were said about systemd... you don't have to use it... until you do... YAT is great don't get me wrong, but the moment some GUI dev requires PS it's no longer YAT... it will be forced down everyones throat.
VMWare (Score:3)
Re: (Score:2)
This is bizarre... (Score:2)
A *shell* as a snap seems to be an odd choice. It should be embedded in whatever environment.
Powershell doesn't make sense as an end in and of itself, and 'Snap' and similar strategies only really possibly make sense for software that is an end in and of itself...
Re: (Score:2)
Since at least Wednesday (Score:4, Interesting)
I installed this Wednesday to check out a challenge someone posted in a forum.
The challenge was to implement the following powershell script using bash:
param(
[Parameter(Mandatory=$True)]
[datetime]$FromDate,
[Parameter(Mandatory=$True)]
[datetime]$ToDate,
[Parameter(Mandatory=$False)]
[ValidateScript({Test-Path -PathType Container $_ })]
[string]$Directory = '.'
)
Get-ChildItem -Include '*.JPG','*.PNG' -Recurse -Path $Directory | Where-Object { $_.CreationTimeUtc -ge $FromDate -and $_.CreationTimeUtc -le $ToDate } | ForEach-Object { $_.FullName }
The challenge author also specified that the bash script should match the functionality of the above including:
Code:
Get-Help
test.ps1 [-FromDate] [-ToDate] [[-Directory] ] []
My first thought was, "I can get a bash script to run on any version of Windows and have been happily using bash and tcsh on Windows since Windows 95 in the 90s. Can that Powershell script run on Linux?" Surprisingly, I installed the powershell core snap, copied the script to test.ps1, and ran it with no issues. It doesn't convert me to powershell, but I was surprised the argument didn't hold.
Re: (Score:2)
The validation might take a few lines, but other than that, I see nothing that cannot easily be done with "find".
Re: (Score:2)
I'd agree. find handles the actual performance of the operation pretty nicely. It was the named parameters, validation, and automatic provision of help that gives powershell a boost. Another nice thing, while using powershell interactively, there was autocompletion on parameter names for commands in the shell. And, I've had issues with find and other linux commands differing from system to system. This wouldn't be as vulnerable to that.
I have to install cygwin on windows to use bash and all of the common G
Hmm... (Score:3)
Snap ... Many see it as the future of Linux, ...
And many don't. (but they did, back in the 1980s when static-linking was all the rage)
PowerShell ... is designed specifically for system administrators and power-users to rapidly automate the administration of multiple operating systems ...
Meaning: Windows, Windows Server ...
Powershell (Score:2)
Powers hell.
IME it's a powerful but clunky piece of garbage.
This ... (Score:2)
... is about the dumbest fucking thing I have ever read.
Re: (Score:1)
Everything is shit (Score:1)
Because the Linux way of things is so much better, where binaries from one distro won't run on another because of ever so slightly different versions between libraries or changes to ABI. Shipping binaries for Ubuntu 16.04 and don't expect them to work correctly on 14.04 or 18.04. That is how we end up in situations where teams are locked to a specific version of a specific distro.
Re: (Score:2)
the Linux way of things is so much better, where binaries from one distro won't run on another because of ever so slightly different versions between libraries or changes to ABI
Got specific examples or is it more fun to fart out generic claims cluelessly?
Re: (Score:2)
Well, if you build for Ubuntu 18.04 and then try to run on say RHEL6, then you are going to have fundamental challenges.
However, if you build RHEL6, then generally that executable can run on Ubuntu 18.04, so a build system should target the oldest you want to support.
This can also trip you up with Windows, but the releases are so infrequent by comparison that people don't notice it as much.
Re: (Score:2)
Well, if you build for Ubuntu 18.04 and then try to run on say RHEL6, then you are going to have fundamental challenges.
Build what?
Re: (Score:3)
/|\ Hey, I think I found Lennart Poettering!
Re: (Score:2)
Docker is not running software on other distros, it's running it on the same distro.
It is of course a fair point that the ecosystem and capabilities of Linux lend itself better to container approaches, but the technical reality is that the approach is a workwround for the problem, rather than addressing the problem.
Of course, here the 'problem' is that developers need to target the oldest version they should support, which isn't too terrible.
Re: (Score:3)
Re: (Score:2)
So you are proposing that the best solution is [...]
The only thing I proposed is that it's all shit. So please don't put words in my mouth when I have been clear and concise on my position.
Re: (Score:2)
Ever heard of static linking? If it's that big a concern to you, then just throw it all in one binary. Or as one big ass self-contained application under /opt. But really, most developers out there know how to use the major distros package managers, so they take the extra 15 minutes it takes to convert and test an rpm as a deb file or whatever. Fuck me, but either you're an idiot, or the laziest human being alive.
Re: (Score:1)
your_soul.so
Re: (Score:2)