PowerShell 7 is the common successor to Windows PowerShell and PowerShell Core. It is currently available in Preview 4, which can be installed side-by-side with other versions of PowerShell. You can run it on Windows, Linux, and macOS, each of which offers several installation options.

Wolfgang Sommergut

Wolfgang Sommergut has over 20 years of experience in IT journalism. He has also worked as a system administrator and as a tech consultant. Today he runs the German publication WindowsPro.de.

Since the first announcement of PowerShell 7, Microsoft has added some new features. For example, the ternary operator is a new language element modeled after C, PHP, or Javascript:

With the ternary operator, Preview 4 introduces an important linguistic innovation

With the ternary operator, Preview 4 introduces an important linguistic innovation

Multi-platform version of Out-GridView ^

The Out-GridView cmdlet, known from Windows PowerShell, returns in PowerShell 7, allowing you to display data graphically in tabular form.

Out GridView is now also available under Linux. It must be installed via its own module

Out GridView is now also available under Linux. It must be installed via its own module

It exists for all platforms that PowerShell 7 supports. It is currently not on board by default; instead, the installation is done with Install-Module Microsoft.PowerShell.GraphicalTools.

This blog post by Microsoft summarizes additional innovations offered in Preview 4.

Installation on Windows ^

You can install PowerShell 7 both alongside Windows PowerShell and in parallel with PowerShell Core. On Windows, there are two ways to do this: manually and via the command line.

For the first option, download the desired release as an MSI from Github, run the installation package, and then let the wizard guide you through the setup. On Github, you can easily overlook the download files because they are hidden in the collapsed Assets section.

The download files for PowerShell 7 are hidden in the collapsed Assets section

The download files for PowerShell 7 are hidden in the collapsed Assets section

PowerShell 7 can also be added entirely from the command line. For this, you need the PSReleaseTools PowerShell module by Jeff Hicks. This can be loaded with the command

which may require a new NuGet provider first. It will be set up automatically after confirmation by the user.

Installing PowerShell 7 using the PSReleaseTools module

Installing PowerShell 7 using the PSReleaseTools module

Subsequently, you can use

to install the current preview with the default values.

Installing PowerShell 7 on Linux ^

On Linux, you can also add PowerShell 7 manually or from the command line. For example, in the case of Ubuntu 18.04, download the corresponding package and install it using the following command:

There is a good chance an error will occur when this command is executed, indicating the required libraries are not available on the system. You can use

to solve this problem.

Installing PowerShell 7 manually using the Debian Package Manager

Installing PowerShell 7 manually using the Debian Package Manager

Alternatively, Microsoft provides a shell script that downloads and installs the appropriate package for each Linux distribution. This can be downloaded using the following command:

Afterward, make the file with

and start it up by entering

Installing PowerShell 7 from a shell script for Linux

Installing PowerShell 7 from a shell script for Linux

Without the "preview" switch, the script would currently install PowerShell Core 6, but will also display a wrong information about the added version. The preview of PowerShell 7 can then be started with the command

Running PowerShell 7 Preview under Ubuntu

Running PowerShell 7 Preview under Ubuntu

Another way to install Ubuntu is to use Canonical's Snap service. Microsoft also uploads its installation package there, and you can retrieve it with

Installing PowerShell 7 from Snap

Installing PowerShell 7 from Snap

In my test, PowerShell 7 proved to be unstable after this installation variant and crashed regularly.

Join the 4sysops PowerShell group!

Your question was not answered? Ask in the forum!

2+

Users who have LIKED this post:

  • avatar
Share
3 Comments
  1. Peter Kriegel 4 weeks ago

    Hi Wolfgang!

     

    Thank you for the good article.

     

    In the past I used the "offical" PowerShell install sripts:

    For Linux:

    https://github.com/PowerShell/PowerShell/blob/master/tools/install-powershell.sh

    Run it like so:

    For Windows:

    https://github.com/PowerShell/PowerShell/blob/master/tools/install-powershell.ps1

    Run it like so:

     

    The difference between the installation of the released version (6) versus the Preview (7) version is the -Preview flag.

     

    See also:

    https://www.thomasmaurer.ch/2019/07/how-to-install-and-update-powershell-7/

    0

  2. Fred Beck 3 weeks ago

    I know this is a silly question but, does a person generally install the 64bit powershell on 64 bit windows?  I assume yes

    0

  3. David Figueroa 3 weeks ago

    Yes. It's built in by default, but you can run the x64 installers (6.x, 7 previews), and it will upgrade both of them.

    David F. 

    0

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2019

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account