Microsoft PowerShell Core For Linux Now Available as a Snap (betanews.com)
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.
A piece of software that fills out a much-needed gap in the Linux world. Thanks, MIcrosoft; we could not expect any less from you.
Why, oh why, would I install something that is: .NET .NET to exist in my system in the first place?
- 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
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.
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. 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.
Digital Citizen