Saltar al contenido

How to install PowerShell 7 on Windows 10

How to install PowerShell 7 on Windows 10

What’s new in PowerShell 7?

The latest version, PowerShell 7, is based on the previous version of PowerShell Core 6.1. It continues to support deployment on multiple platforms and adds a number of new features, cmdlets and troubleshooting. Some of the most important new features include:

  • Parallelization ofFor each object sewerage with : iterate through elements of a collection in parallel with the new one -Parallelparameter or set a maximum number of threads (default is five) with -ThrottleLimitparameters.
  • Incorporation of new operators:

    • Ternary operator «? : ”: Works very similar to an if-else statement when comparing two expressions with a condition to see if they are true or false, e.g. Test path «C: Users»? «Exists»: «does not exist»
    • «||» pipeline chain operators and “&&”: The && operator executes the right pipe if the left pipe was successful. In contrast, || The operator runs the right pipe only if the left pipe fails.
  • Get-Error cmdlet: a simplified and dynamic error view for easier investigation of the most recent error in the current session.
  • New automatic notifications: Notify users users when a new version of PowerShell is available. The default update checks for a new version once a day.

In addition to the new features listed above, Microsoft has added many other cmdlets, experimental enhancements, and added PowerShell 7 to the long-term service launch, allowing you to receive updates as long as .Net 3.1 is supported. A complete list of everything new, solutions and improvements is available in Github change log for PowerShell 7.

How to install PowerShell 7 with an MSI package

PowerShell 7 is available for Windows, macOS and Linux. We will show you how to install it on Windows 10.

The first method we will cover is using an MSI file to install PowerShell. MSI packages work almost identically with an EXE file and allow you to install a program using a graphical user interface. It is an installation method that uses only the necessary and basic files needed. All you have to do is double-click the package to start the setup wizard.

Note: PowerShell 7 installs and runs in parallel with Windows PowerShell 5.1, the version that ships with Windows 10, and replaces PowerShell Core 6.x. If you need to run PowerShell 6 in parallel with PowerShell 7, you will need to install it using the ZIP package.

To download the package, start your browser and log in PowerShell Github version page. Scroll down to the Active section and click on the version of the MSI package to download it.

Make sure you select the appropriate package for your version of Windows, x64 for 64-bit systems and x86 for 32-bit systems. If you are not sure what you have, it is easy to find out which is your running system.

If prompted, choose a download destination and click «Save» to begin the download.

After the download is complete, navigate to the folder where the file is located and double-click it to run the installation.

Find the MSI package and double-click it to open and run the wizard.

How to install PowerShell 7 with a single command

The PowerShell team also has created a script which you can invoke directly from PowerShell. It is a single-line cmdlet that automatically downloads and runs the configuration wizard. All you have to do is paste the code snippet and press the Enter key.

Launch PowerShell and copy / paste the following cmdlet into the window:

iex "& {$ (irm} -UseMSI"

Type the following command to download the MSI PowerShell package.

Press the Enter key and PowerShell will run the command and start downloading.

Press Enter and the package will download.

Go through the installation program

When the setup wizard opens, click «Next» to install PowerShell 7.

On the next screen, choose a destination folder and then click «Next» when you’re ready to continue.

Click Next.  "

You can then decide which optional features to enable during installation. You can enable or disable the following four options:

  • Add PowerShell to the path environment variable: adds PowerShell to the Windows path environment variable and allows you to call PowerShell from any other shell or terminal.
  • Record the Windows event log manifest: adds PowerShell to the Windows event log manifest and allows you to log events from a PowerShell instance.
  • Enable communication at a distance of PowerShell: allows the ability to remotely execute commands.
  • Add «Open Here» context menus in Explorer: adds an option to the right-click context menu that opens an instance of PowerShell in the folder you click.

Click «Next» after choosing all the optional features you want.

Choose the optional features you want and click "Next" to continue.

Click «Install» to begin the installation. A UAC message will appear asking for administrator privileges to install the package. Click «Yes» to continue.

After completing the setup wizard, click «Finish» to exit.

How to open PowerShell 7

After the installation is complete, you can open PowerShell 7 in several ways.

If you selected the options «Add PowerShell to the path environment variable» and «Add context menus» Open here «in Explorer», you can type «pwsh» at the command prompt or right-click a folder and click PowerShell 7> Opening Here. However, one of the simplest methods is to search using the Start menu.

Press the Windows key or click the Start button, type «pwsh» in the text field, and press Enter or click «Open» when PowerShell 7 appears in the results.

Look for PowerShell in the Windows search bar.

You’ll know you’re using the current and updated version of PowerShell by looking for «PowerShell 7» in the title bar of the window.

Make sure you are running PowerShell 7 in the upper corner of the program.