How to Install PowerShell 7

PowerShell has come a long way from when it labeled Windows PowerShell. Nowadays, PowerShell is available on nearly every platform you can think of and supports a growing number of features and functionalities. The latest version of PowerShell, PowerShell v7, is no different.

PowerShell 7 is Microsoft’s latest iteration of the popular scripting language. It inches closer to bringing PowerShell Core in parity with its predecessor Windows PowerShell while consistently adding new functionality.

The PowerShell team provides a detailed breakdown of all the latest features on the PowerShell GitHub releases page.

So you’re ready to see what PowerShell 7 can do. You’re going to have to get it installed. PowerShell 7, like previous versions of PowerShell Core, has a straightforward installation process but with some gotchas.

Sponsored Content

Maximize Value from Microsoft Defender

In this ebook, you’ll learn why Red Canary’s platform and expertise bring you the highest possible value from your Microsoft Defender for Endpoint investment, deployment, or migration.

PowerShell 7 Preview 3 and Windows

As of this writing, PowerShell 7 is in preview mode and is at preview mode 3. This is the version you’re going to be installing.

PowerShell 7 is available cross-platform. It can be installed on Windows, macOS, Linux, and others. For this article, we’re going to be focusing on getting it installed on Windows.

Installing via GitHub

You’ll first need to download PowerShell 7 from the PowerShell GitHub repo releases page. Since PowerShell 7 Preview 3 is the latest version available now, that’s what you’ll be installing.

To install it manually from the GitHub repo, you can find the version you’d like to install and find the Assets section. Then, find the operating system you’d like to install it on. To install on Windows for Preview 3, the name is PowerShell-7.0.0-preview.3-win-x64.msi.

Download this file and walk through the installation.

Installing via Script

If you’d like to save a bit of time, you can download and install PowerShell 7 on Windows directly from Windows PowerShell. You can, after all, install PowerShell 7 and Windows PowerShell side by side.

To install PowerShell 7 from Windows PowerShell, you can use a PowerShell script (install-powershell.ps1) provided by Microsoft. You can download and run this script in one shot using this simple one-liner. As you can see below, this method creates a folder in your TEMP directory and download the latest version of PowerShell.

What you don’t see is that it will run the MSI where you can run through the wizard to get it installed.

This is, by far, the easiest way to get PowerShell 7 up and running quickly.

PS51> Invoke-Expression "& { $(Invoke-RestMethod -Uri https://aka.ms/install-powershell.ps1) } -UseMSI -Preview"

Directory: C:\Users\Administrator\AppData\Local\Temp

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/26/2019 8:41 AM anbtqb1l.ov1
VERBOSE: About to download package from

Directory: C:\Users\Administrator\AppData\Local\Temp\anbtqb1l.ov1

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/26/2019 8:41 AM new

Above, you used the UseMSI  and Preview  parameters. These parameters forced the script to use the pre-packaged MSI Microsoft provides. Using the Preview  parameter allows you to download preview versions of PowerShell. In this case, since PowerShell 7 is in preview, this is required.

You can also use other optional parameters like:

Destination  to pick the path to install to. By default, the installer will choose C:\Program Files\PowerShell\7.
Daily  to install the bleeding edge version from the daily builds
Quiet  to silently install PowerShell without bringing up the wizard
DoNotOverwrite  to not overwrite the destination folder if it already exists
AddToPath  to add the PowerShell installation folder to the user PATH environment variable

To install PowerShell 7 at this time, only the UseMSI  and Preview  parameters are required.


If you haven’t yet tried out PowerShell 7 yet, I highly encourage you to do so. PowerShell 7 brings PowerShell Core ever closer to Windows PowerShell. There is still some work to be done but the PowerShell team has consistently been releasing new versions once/month and are on track to do so until PowerShell 7 becomes generally available (GA).

Using the one-liner described in this article will allow you to easily pull down and install the latest version with minimal effort.

Related Topics:


Don't have a login but want to join the conversation? Sign up for a Petri Account

Comments (0)

Leave a Reply

Entrepreneur, hustler, husband, dad, Automator, content producer, published author, Microsoft MVP, DevOps pro and passionate problem-solver.
External Sharing and Guest User Access in Microsoft 365 and Teams

This eBook will dive into policy considerations you need to make when creating and managing guest user access to your Teams network, as well as the different layers of guest access and the common challenges that accompany a more complicated Microsoft 365 infrastructure.

You will learn:

  • Who should be allowed to be invited as a guest?
  • What type of guests should be able to access files in SharePoint and OneDrive?
  • How should guests be offboarded?
  • How should you determine who has access to sensitive information in your environment?

Sponsored by:

Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: