Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

PowerShell comes to MacOS and Linux. Oh and Windows too
The Register ^ | Jan 12, 2018 | Simon Sharwood

Posted on 01/12/2018 6:11:41 AM PST by dayglored

Microsoft has given the world new versions of PowerShell that bring the popular automation and scripting tool to MacOS and Linux.

PowerShell Core 6.0’s both an upgrade and a replacement for its predecessors.

It’s a replacement because Microsoft is no longer actively developing its predecessor, “Windows PowerShell”. That tool will be kept secure in future updates to Windows Server and Windows.

Those of you looking for future fun, by way of enhancements, need to adopt PowerShell Core. That moniker reflects the fact it runs with the .Net Core, rather than the Windows-only .NET framework.

The change has been made because Microsoft wants sysadmins to have one toolset to work with in whatever operating environment takes their fancy. That idea’s fuelled by Redmond’s belief that in a hybrid cloud world there’s every chance you’ll wrangle Windows or Linux servers from a Mac or penguin-powered machines. Or even a Windows PC.

Microsoft has listed the new features of PowerShell Core 6.0 here. Among the interesting additions are Docker support, sensitivity to the fact that MacOS and Linux filesystems can handle file names that Windows chokes on, SSH remoting and dozens of new cmdlets.

Among some curiosities Microsof has noted is an unsupported version of the tool for Windows on ARM and another for Rasbpian. There’s also a warning that Linux users may need to do a fresh install of version 6.0 rather than upgrade.

And just to confuse matters, while version 6.0 is the latest and greatest, Microsoft also offers PowerShell Core 5.0 and 5.1 with its Nano Server.

PowerShell Core 6.0 for Windows can be found here, and for MacOS and Linux here. ®


TOPICS: Business/Economy; Computers/Internet; Hobbies
KEYWORDS: linux; macos; powershell; windowspinglist
Navigation: use the links below to view more comments.
first 1-2021-30 next last
This is pretty cool. PowerShell is a very useful scripting tool/language.
1 posted on 01/12/2018 6:11:41 AM PST by dayglored
[ Post Reply | Private Reply | View Replies]

To: Abby4116; afraidfortherepublic; aft_lizard; AF_Blue; amigatec; AppyPappy; arnoldc1; ATOMIC_PUNK; ...
PowerShell goes Platforms ... PING!

You can find all the Windows Ping list threads with FR search: just search on keyword "windowspinglist".

2 posted on 01/12/2018 6:12:33 AM PST by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 1 | View Replies]

To: dayglored
How cool is this, on a Microsoft page?

Installing PowerShell Core on macOS and Linux

3 posted on 01/12/2018 6:14:09 AM PST by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 1 | View Replies]

To: dayglored

There are a lot of Unix/Lunix scripting tools out in the wild. Microsoft is trying to bring some sanity to the world.


4 posted on 01/12/2018 6:19:04 AM PST by ImJustAnotherOkie
[ Post Reply | Private Reply | To 1 | View Replies]

To: dayglored

Am I missing something?

To me, “scripting” is the enemy of security of PC’s.

I’ve long been a heavy Linux user. Since 1994.

I’m no fan of MS’s swiss cheese of operating systems. (not because they can’t secure them, but they won’t. For their own reasons)


5 posted on 01/12/2018 6:19:12 AM PST by Texas Fossil ((Texas is not where you were born, but a Free State of Heart, Mind & Attitude!))
[ Post Reply | Private Reply | To 3 | View Replies]

To: Texas Fossil

Apple has had a very good yet little used “power shell “built into its OS for years it’s call Apple Script.


6 posted on 01/12/2018 6:31:24 AM PST by gibsonguy
[ Post Reply | Private Reply | To 5 | View Replies]

To: gibsonguy

Apple has always been a stable operating system. It’s roots are in FreeBSD.

I’m about due an upgrade on this system and a new install. It will be some form of Linux or possibly OpenBSD.

Currently running Debian and XFCE.


7 posted on 01/12/2018 6:43:41 AM PST by Texas Fossil ((Texas is not where you were born, but a Free State of Heart, Mind & Attitude!))
[ Post Reply | Private Reply | To 6 | View Replies]

To: Texas Fossil
To me, “scripting” is the enemy of security of PC’s.

Uhhh--No.

Scripting is just a way to automate tasks. No more. No less.

8 posted on 01/12/2018 6:59:02 AM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 5 | View Replies]

To: Texas Fossil
Currently running Debian and XFCE.

I love XFCE. My OS is Fedora, though. I never even install Gnome or KDE.

9 posted on 01/12/2018 7:07:25 AM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 7 | View Replies]

To: ImJustAnotherOkie
There are a lot of Unix/Lunix scripting tools out in the wild. Microsoft is trying to bring some sanity to the world.

Sanity? I'd call it hegemony. If they'd simply port the commands to Linux, bash would be all we'd need. You can pretty much do anything with Bash.

Here's a bash script that will play a round of Bunco...

#!/bin/bash

rolldie()
{
   local result=$1
   rolled=$(( ( $RANDOM % 6 ) + 1 ))
   eval $result=$rolled
}

BuncoRound()
{
   # roll, display, and score a round of bunco!
   # round is specified when invoked, score added to totalscore
 
   local score=0 ; local round=$1 ; local hidescore=0
 
   rolldie die1 ; rolldie die2 ; rolldie die3
   echo Round $round. You rolled: $die1 $die2 $die3
 
   if [ $die1 -eq $die2 ] && [ $die2 -eq $die3 ] ; then
     if [ $die1 -eq $round ] ; then
       echo "  BUNCO! You score 21!"
       score=21
       hidescore=1
     else
       echo "  Mini Bunco! You score 5!"
       score=5
       hidescore=1
     fi
   else
     if [ $die1 -eq $round ] ; then
       score=1
     fi
     if [ $die2 -eq $round ] ; then
       score=$(( $score + 1 ))
     fi
     if [ $die3 -eq $round ] ; then
       score=$(( $score + 1 ))
     fi
   fi
 
   if [ $hidescore -eq 0 ] ; then
     echo "  score this round: $score"
   fi
 
   totalscore=$(( $totalscore + $score ))
}

for round in {1..6} ; do
  BuncoRound $round
done
  echo "Total Score: $totalscore"

For example:

$ bunco
Round 1. You rolled: 2 4 1
  score this round: 1
Round 2. You rolled: 6 1 6
  score this round: 0
Round 3. You rolled: 2 3 2
  score this round: 1
Round 4. You rolled: 4 1 5
  score this round: 1
Round 5. You rolled: 3 3 3
  Mini Bunco! You score 5!
Round 6. You rolled: 1 5 3
  score this round: 0
Total Score: 8

10 posted on 01/12/2018 7:08:35 AM PST by zeugma (I always wear my lucky red shirt on away missions!)
[ Post Reply | Private Reply | To 4 | View Replies]

To: ShadowAce

I started using XFCE when Redhat 5 came out. It was not part of the package, but I was so disappointed with the bloat at the time that I looked for something lighter. Downloaded XFCE and installed it. Never looked back.

There are other very light GUI’s but XFCE is Gnome compliant and works for me.


11 posted on 01/12/2018 7:17:43 AM PST by Texas Fossil ((Texas is not where you were born, but a Free State of Heart, Mind & Attitude!))
[ Post Reply | Private Reply | To 9 | View Replies]

To: ShadowAce

“scripting”

OK, Thanks.


12 posted on 01/12/2018 7:19:11 AM PST by Texas Fossil ((Texas is not where you were born, but a Free State of Heart, Mind & Attitude!))
[ Post Reply | Private Reply | To 8 | View Replies]

To: zeugma
You can pretty much do anything with Bash.

I have increased the productivity of my entire team using just bash and expect. In the range of several hundred percent. I've written scripts that have reduced our time on task from several days down to 15 minutes. As a result, we get a lot more done with a LOT less worries/frustration/stress in our jobs.

13 posted on 01/12/2018 7:19:29 AM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 10 | View Replies]

To: Texas Fossil

No problem. I understand that the term can be misunderstood due to the media hype surrounding people who can use the concept.


14 posted on 01/12/2018 7:20:39 AM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 12 | View Replies]

To: ShadowAce

I use No Script on my browser, it has made life better for me.

It did educate me about how many scripts are running on prominent websites. Headshake.

No wonder it seem like the browser stops when you go to one of them.


15 posted on 01/12/2018 7:22:37 AM PST by Texas Fossil ((Texas is not where you were born, but a Free State of Heart, Mind & Attitude!))
[ Post Reply | Private Reply | To 14 | View Replies]

To: Texas Fossil
...but XFCE is Gnome compliant and works for me.

That is why I use it as well--it works for me, and I don't have to adjust my work methods/styles to work within it.

16 posted on 01/12/2018 7:23:21 AM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 11 | View Replies]

To: zeugma

Not to bash Bash but PowerShell let’s you access just about the all of the .Net functionality directly without having a bunch of little quirky little utilities.


17 posted on 01/12/2018 7:23:53 AM PST by ImJustAnotherOkie
[ Post Reply | Private Reply | To 10 | View Replies]

To: Texas Fossil
No wonder it seem like the browser stops when you go to one of them.

Yeah--NoScript and an ad blocker make the Net usable.

18 posted on 01/12/2018 7:24:53 AM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 15 | View Replies]

To: gibsonguy

Apple Script is the most godawful thing second only to iTunes.


19 posted on 01/12/2018 7:25:56 AM PST by ImJustAnotherOkie
[ Post Reply | Private Reply | To 6 | View Replies]

To: ImJustAnotherOkie
PowerShell let’s you access just about the all of the .Net functionality directly

True and valid point. how dotNet libraries are invoked is often absurdly baroque but usually PowerShell can handle invoking with the correct types. In fact if the library is complete the types can be imported into PS with just a reference. However when you get down to that level you might as well be programming in C#.

One has to be careful not to abuse this too much. For example I once wrote some amusing PS code for generating C# code based on parameters and creating a signed assembly to then stuff into SQL Server directly for use as a function called by scripts invoked in a distributed environment. This was a performance optimization for scrubbing multi-billion row tables in a live system, IIRC. My excuse? it was a death march. Amusingly I also invoked the SAS motto to help characterize the rationale for the risk acceptance meeting..."who dares, wins".

20 posted on 01/12/2018 8:22:41 AM PST by no-s (when democracy is displaced by tyranny, the armed citizen still gets to vote...)
[ Post Reply | Private Reply | To 17 | View Replies]


Navigation: use the links below to view more comments.
first 1-2021-30 next last

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson