قالب وردپرس درنا توس
Home / Tips and Tricks / How to install PowerShell 7 on Windows 10

How to install PowerShell 7 on Windows 10



  PowerShell 7 Avatar header.
Microsoft

Microsoft announced PowerShell 7.0 on March 4, 2020. It is the latest major update to PowerShell, Microsoft's command line shell and multi-platform scripting language. Here's what's new ̵

1; and how to install it on your Windows PC.

What's new in PowerShell 7?

The latest version, PowerShell 7, is based on the previous PowerShell Core 6.1. It continues to support distribution across platforms and adds a host of new features, cmdlets and bug fixes. Some of the more significant new features include:

  • Pipeline parallelization with ForEach-Object : Iterate through objects in a collection parallel to the new Parallel parameter or set a maximum number of threads (default is five) with the parameters -ThrottleLimit .
  • The addition of new operators:
    • Ternary operator “? : ": Works much like a statement if otherwise, by comparing two terms against a condition to see if it is true or false, for example Test path" C: user "? "exist": "does not exist"
    • Wire Chain Operators “||” and "&&": The operator && runs the right pipeline if the left pipeline was successful. Conversely, || the operator runs the right line only if the left pipeline fails.
  • Get-Error cmdlet: A simplified and dynamic error view for easier investigation of the latest error in the current session.
  • Automatic new version notifications: Notify users when a new version of PowerShell is available. The standard update checks 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 its Long Term Servicing version, enabling updates as long as .Net 3.1 is supported. A complete list of all the new fixes and enhancements is available from the PowerShell 7. Github switcher

RELATED: How PowerShell differs from Windows command prompt

How to install PowerShell 7 with an MSI package [19659005] PowerShell 7 is available for Windows, macOS and Linux. We'll 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 to an EXE file and allow you to install a program with a graphical user interface. It is an installation method that uses only the necessary and core files needed. All you need to do is double-click the package to start the installation wizard.

Note: PowerShell 7 installs and runs side by side with Windows PowerShell 5.1 – version that comes with Windows 10 – and replaces PowerShell Core 6.x. If you need to run PowerShell 6 side by side with PowerShell 7, you must install it via the ZIP package.

To download the package, look up your web browser and go over the PowerShell Github release page. Scroll down to the Assets section and click on the MSI package to download it.

 Choose the package that suits you.

Be sure to choose the right package for your version for Windows, x64 for 64-bit and x86 for 32-bit systems. If you are unsure which one you have, it is easy to find out which system you are running.

RELATED: How do I know if I run 32-bit or 64-bit Windows?

If prompted, select a destination for the download and click "Save" to start the download.

When the download is complete, navigate to the folder where the file is 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 command

The PowerShell team has also put together a script that you can invoke directly from PowerShell. It is a cmdlet with a liner that downloads and runs the installation wizard automatically. All you have to do is paste the code snippet and press the Enter key.

Turn off PowerShell and copy / paste the following cmdlet into the window:

  iex "& {$ (irm https: // aka. Ms / install-powershell.ps1)} -UseMSI" 

  Type the following command i to download the MSI package from PowerShell.

Press the Enter key and PowerShell executes the command and starts the download.

 Press Enter and the package will be downloaded.

Review the installer

When the installation wizard opens, click "Next" to install PowerShell 7.

Select the next screen on the next screen and then click "Next" when you are ready to continue.

 Click

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

  • Add PowerShell to Path Environment Variable: Adds PowerShell to the Windows Path environment variable and allows you to call PowerShell from any other shell or terminal.
  • Register Windows Event Logging Manifest: Adds PowerShell to Windows Event Logging Manifest and allows you to log events from a PowerShell instance.
  • Enable PowerShell Remoting: Enables the ability to run commands remotely.
  • Add & # 39; Open Here & # 39; Context Menus to the Explorer: Adds an option to the right-click context menu that opens an instance of PowerShell in the folder you click.

Click "Next" when you have selected all the optional features you want. [19659017]   Select the optional features you want and click on

Click "Install" to begin the installation. A UAC prompt will be displayed, asking for administrator privileges to install the package. Click "Yes" to continue.

When the installation wizard is complete, click "Finish" to finish.

How to open PowerShell 7

Once the installation is complete, you can open PowerShell 7 in some ways.

If you selected the options "Add PowerShell to Path Environment Variable" and "Add" Open Here "context menus in Explorer", you can type "pwsh" in the Command Prompt or right-click a folder and click PowerShell 7> Open 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.

 Search for PowerShell from the Windows search box.

You know that you are 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 top corner of the program.




Source link