Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

Now You Can Run PowerShell on Both Linux and macOS

Explore Now You Can Run PowerShell on Both Linux and macOS, with key facts, clear context, practical implications, and useful takeaways.

Table of Contents

This article examines Now You Can Run PowerShell on Both Linux and macOS. It presents the main facts, practical implications, and key points in a clearer, easier-to-follow format.

Understanding Now You Can Run PowerShell on Both Linux and macOS

A cross-platform open source version of PowerShell called PowerShell Core 6.0 has just been released by Microsoft, not only running on Windows, but it can run on both macOS and Linux. In the near future, this version will also deploy with the original PowerShell we have used for 10 years.

Widely released from 10/1, PowerShell Core supports Windows 7+, Ubuntu, Redhat, Centos, macOS, Fedora, OpenSuse and Debian, allowing system administrators to use common administration scripting languages to run on every server.

Microsoft has provided instructions for installing PowerShell Core for both macOS, Linux and Windows. On Windows, you only need to download and run the file to install PowerShell in parallel with the current PowerShell, thereby easily running the test and putting the current PowerShell script into PowerShell Core.

To install PowerShell on Linux and macOS, Microsoft releases packages for most Linux kernels. For example, installing PowerShell Core on Ubuntu 16.04, run the following command:

# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list

# Update the list of products
sudo apt-get update

# Install PowerShell
sudo apt-get install -y powershell

# Start PowerShell
pwsh

Once installed, start from the console with the. pwsh command .

Now You Can Run PowerShell on Both Linux and macOS illustration PowerShell Core on Ubuntu 16.0 4

Unfortunately, for PowerShell Core to work on many OSs, Microsoft has to give up quite a bit of technology.

To switch to. NET Core and other OSs, we are forced to abandon some of the technologies being used on Windows PowerShell. We take advantage of PowerShell refactor to stop supporting some of the less-used technologies. Some will return to PowerShell Core but many of them are not. At a high level, there are:

  • PowerShell Workflows
  • PowerShell Snap-ins
  • WMIv1 cmdlets (Get-WmiObject, Invoke-WmiMethod.) Encourage using CIM/WMIv2 cmdlets (Get-CimInstance, Invoke-CimMethod.)
  • The Desired State Configuration (DSC) Executing resources use PowerShell Core.

We also have many minor language changes, the engine and PowerShell cmdlets, which can technically be considered breakthroughs. For more information, please read Breaking Change at: https://github.com/PowerShell/PowerShell/blob/master/docs/BREAKINGCHANGES.md.

These changes will prevent existing PowerShell scripts from working on the Core without modification.

FAQ

What is the main point of Now You Can Run PowerShell on Both Linux and macOS?

A cross-platform open source version of PowerShell called PowerShell Core 6.0 has just been released by Microsoft, not only running on Windows, but it can run on both macOS and Linux. In the near future, this version will also deploy with the original PowerShell we have used for.

Why is Now You Can Run PowerShell on Both Linux and macOS important?

Now You Can Run PowerShell on Both Linux and macOS matters because it can affect how readers understand, choose, use, or respond to the subject discussed in the article.

What should readers verify about Now You Can Run PowerShell on Both Linux and macOS?

Check the date, product or software version, compatibility, and any current guidance before acting, especially when technology, security, health, or pricing is involved.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.