Как установить и обновить power shell 7. краткое руководство

Windows PowerShell is installed on Windows systems by default. But that’s Windows PowerShell and not PowerShell. To make the most out of PowerShell, you should upgrade to PowerShell 7. In this article, you will learn how to install and update PowerShell 7.

Table of contents

  • Windows PowerShell vs PowerShell
  • PowerShell versions and release date
  • Find PowerShell version
  • Install PowerShell 7
  • Update PowerShell 7
  • Frequently Asked Questions (FAQ)
  • Conclusion

Windows PowerShell vs PowerShell

There are two PowerShell versions that you need to be aware of:

  • Windows PowerShell (version 1.0 – 5.1)
    It’s preinstalled on all modern Windows client and server OS releases. It’s not being developed further, and the latest version is 5.1. The executable is powershell.exe.
  • PowerShell (version 6 and higher)
    It’s not preinstalled on any version of Windows. It’s actively being developed, is much faster, and has better commands available. The executable is pwsh.exe.

Note: You can have both Windows PowerShell and PowerShell versions installed next to each other on the same system.

PowerShell versions and release date

PowerShell has gone a long way since its first release. See the table below for all the PowerShell versions and their release date.

PowerShell versionRelease date
PowerShell 7.4November 2023
PowerShell 7.3November 2022
PowerShell 7.2November 2021
PowerShell 7.1November 2020
PowerShell 7March 2020
PowerShell 6.2March 2019
PowerShell 6.1September 2018
PowerShell 6.0January 2018
Windows PowerShell 5.1August 2016
Windows PowerShell 5.0February 2015
Windows PowerShell 4.0October 2013
Windows PowerShell 3.0October 2012
Windows PowerShell 2.0July 2009
Windows PowerShell 1.0November 2006

Find PowerShell version

Note: Windows PowerShell and PowerShell are different versions and you need to start the correct PowerShell window and run the command below.

$PSVersionTable.PSVersion

This is how it looks if you run it in Windows PowerShell.

Major Minor Build Revision
----- ----- ----- --------
5 1 20348 1

See the screenshot below.

Install and Update PowerShell 7 check version Windows PowerShell

This is how it looks if you run it in PowerShell.

Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 4 0

See the screenshot below.

Install and Update PowerShell 7 check version PowerShell

Method 1: One-liner

This is the fastest and easiest method to install PowerShell 7.

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

After that, you see the PowerShell 7 setup wizard that you can go through.

Install and Update PowerShell 7 setup

Ensure you enable all options.

Как установить и обновить power shell 7. краткое руководство

Since PowerShell 7.2 and higher, Microsoft will automatically update PowerShell 7 in the same release channel if you enable it in the setup wizard. For example, PowerShell 7.2.x to 7.2.y and 7.3.x to 7.3.y.

Enable both options.

Install and Update PowerShell 7 Microsoft Update

Finish the installation.

Как установить и обновить power shell 7. краткое руководство

PowerShell 7 appears in your programs.

Как установить и обновить power shell 7. краткое руководство

Method 2. Download from GitHub

Go to the PowerShell GitHub page and download the PowerShell 7 installer.

Install and Update PowerShell 7 GitHub

Open the PowerShell .msi file and go through the setup wizard, as shown in the above method.

Method 3: WinGet (Windows Package Manager)

Run the below command to download and install PowerShell 7.

Note: It will automatically install PowerShell 7 once downloaded, and you will not see the setup wizard.

winget install --id Microsoft.Powershell

Update PowerShell 7

It’s best to update PowerShell 7 every time a new version is out.

Use the winget upgrade command to update PowerShell 7 to the latest version.

winget upgrade --id Microsoft.PowerShell

The other methods to upgrade PowerShell 7 are to download the installer from GitHub or run the one-liner as shown above, which then you can go through the setup wizard to update PowerShell.

Frequently Asked Questions (FAQ)

How to uninstall Windows PowerShell 5.1 on Windows after installing PowerShell 7?

You don’t. It’s integrated with Windows OS, and you must leave it on your system.

Why does Windows PowerShell ISE show version 5.1 when I have PowerShell 7 installed?

PowerShell ISE loads Windows PowerShell 5.1 and not PowerShell 7.

How can I keep using Windows PowerShell ISE with PowerShell 7?

Switch over to Visual Studio Code. It’s a free, lightweight, open-source, cross-platform code editor.

Will PowerShell 7 load automatically in Visual Studio Code?

PowerShell 7 takes precedence over Windows PowerShell 5.1 and loads by default.

Can I switch between Windows PowerShell 5.1 and PowerShell 7 in Visual Studio Code?

Select a default profile and choose Windows PowerShell 5.1 or PowerShell 7.

Why doesn’t Microsoft ship PowerShell 7 with Windows?

Microsoft plans to eventually ship PowerShell 7 in Windows as a side-by-side feature with Windows PowerShell 5.1. But they still need to work out some details, and there is no timeline for when that will happen.

Should I use Windows PowerShell 5.1 or PowerShell 7?

You should definitely use PowerShell 7 when you can. But ensure you test all your cmdlets and scripts before transitioning to PowerShell 7.

Conclusion

You learned how to install and update PowerShell 7. Ensure that you use PowerShell 7 when you can because it’s kept up to date by Microsoft and performs much faster than the older versions. If it’s impossible to port some of your commands and scripts to PowerShell 7, then keep using PowerShell 5.1 for those.

:/>  SUPRA STV-LC4217F. Ремонт, схема, сервис
PowerShell
Как установить и обновить power shell 7. краткое руководство
Как установить и обновить power shell 7. краткое руководство

Screenshot of a PowerShell 7 session in Windows Terminal

ParadigmImperative, pipeline, object-oriented, functional and reflective
Designed byJeffrey Snover, Bruce Payette, James Truher (et al.)
DeveloperMicrosoft
First appearedNovember 14, 2006; 17 years ago
Stable release
Typing disciplineStrong, safe, implicit and dynamic
Implementation languageC#
PlatformPowerShell: .NET
Windows PowerShell: .NET Framework
OS
LicenseMIT License[2] (but the Windows component remains proprietary)
Filename extensions
  • .ps1 (Script)
  • .ps1xml (XML Document)
  • .psc1 (Console File)
  • .psd1 (Data File)
  • .psm1 (Script Module)
  • .pssc (Session Configuration File)
  • .psrc (Role Capability File)
  • .cdxml (Cmdlet Definition XML Document)
Website
Influenced by
Python, Ksh, Perl, C#, CL, DCL, SQL, Tcl, Tk,[3] Chef, Puppet

PowerShell includes its own extensive, console-based help (similar to man pages in Unix shells) accessible via the Get-Help cmdlet. Updated local help contents can be retrieved from the Internet via the Update-Help cmdlet. Alternatively, help from the web can be acquired on a case-by-case basis via the -online switch to Get-Help.

Как установить и обновить power shell 7. краткое руководство
The first version of PowerShell
Как установить и обновить power shell 7. краткое руководство
PowerShell for Linux 7.3.1 on Ubuntu 22.10

  • cmdlets (.NET Framework programs designed to interact with PowerShell)
  • PowerShell scripts (files suffixed by .ps1)
  • PowerShell functions
  • Standalone executable programs

Extended Type System

The number of cmdlets included in the base PowerShell install has generally increased with each version:

VersionCmdletsRef
Windows PowerShell 1.0[38]
Windows PowerShell 2.0[39]
Windows PowerShell 3.0[40]
Windows PowerShell 4.0?
Windows PowerShell 5.0[41]
Windows PowerShell 5.1[]
PowerShell Core 6.0?
PowerShell Core 6.1?
PowerShell Core 6.2?
PowerShell 7.0[]
PowerShell 7.1?
PowerShell 7.2?
PowerShell 7.4

 
 # Definition of static parameters # Definition of dynamic parameters # Set of instruction to run at the start of the pipeline # Main instruction sets, ran for each item in the pipeline # Set of instruction to run at the end of the pipeline 
 

Desired State Configuration

Upon running a configuration, DSC will ensure that the system gets the state described in the configuration. DSC configurations are idempotent. The Local Configuration Manager (LCM) periodically polls the system using the control flow described by resources (imperative pieces of DSC) to make sure that the state of a configuration is maintained.

Initially using the code name “Monad”, PowerShell was first shown publicly at the Professional Developers Conference in October 2003 in Los Angeles. All major releases are still supported, and each major release has featured backwards compatibility with preceding versions.

Windows PowerShell 1.0

Как установить и обновить power shell 7. краткое руководство
Windows PowerShell 1.0 session using the Windows Console

Windows PowerShell 2.0

Как установить и обновить power shell 7. краткое руководство
Windows PowerShell ISE v2.0 on Windows 7, an integrated development environment for PowerShell scripts

Windows PowerShell 3.0

  • Scheduled jobs: Jobs can be scheduled to run on a preset time and date using the Windows Task Scheduler infrastructure.
  • Session connectivity: Sessions can be disconnected and reconnected. Remote sessions have become more tolerant of temporary network failures.
  • Improved code writing: Code completion (IntelliSense) and snippets are added. PowerShell ISE allows users to use dialog boxes to fill in parameters for PowerShell cmdlets.
  • Delegation support: Administrative tasks can be delegated to users who do not have permissions for that type of task, without granting them perpetual additional permissions.
  • Help update: Help documentations can be updated via Update-Help command.
  • Automatic module detection: Modules are loaded implicitly whenever a command from that module is invoked. Code completion works for unloaded modules as well.
  • New commands: Dozens of new modules were added, including functionality to manage disks get-WmiObject win32_logicaldisk, volumes, firewalls, network connections, and printers, which had previously been performed via WMI.[further explanation needed]

Windows PowerShell 4.0

New features in PowerShell 4.0 include:

  • Desired State Configuration:[83][84][85] Declarative language extensions and tools that enable the deployment and management of configuration data for systems using the DMTF management standards and WS-Management Protocol
  • New default execution policy: On Windows Servers, the default execution policy is now RemoteSigned.
  • Save-Help: Help can now be saved for modules that are installed on remote computers.
  • Enhanced debugging: The debugger now supports debugging workflows, remote script execution and preserving debugging sessions across PowerShell session reconnections.
  • -PipelineVariable switch: A new ubiquitous parameter to expose the current pipeline object as a variable for programming purposes
  • Network diagnostics to manage physical and Hyper-V‘s virtualized network switches
  • Where and ForEach method syntax provides an alternate method of filtering and iterating over objects.

Windows PowerShell 5.0

Как установить и обновить power shell 7. краткое руководство
PowerShell 5.0 icon

Key features included:

  • The new class keyword that creates classes for object-oriented programming
  • The new enum keyword that creates enums
  • OneGet cmdlets to support the Chocolatey package manager[87]
  • Extending support for switch management to layer 2 network switches.[88]
  • Debugging for PowerShell background jobs and instances of PowerShell hosted in other processes (each of which is called a “runspace”)
  • Desired State Configuration (DSC) Local Configuration Manager (LCM) version 2.0
  • DSC partial configurations
  • DSC Local Configuration Manager meta-configurations
  • Authoring of DSC resources using PowerShell classes
:/>  Как пожаловаться в стиме на игру

Windows PowerShell 5.1

PowerShell Core 6

  • The -Parallel switch for the ForEach-Object cmdlet to help handle parallel processing
  • Near parity with Windows PowerShell in terms of compatibility with built-in Windows modules
  • A new error view
  • The Get-Error cmdlet
  • Pipeline chaining operators (&& and ||) that allow conditional execution of the next cmdlet in the pipeline
  • The ?: operator for ternary operation
  • The ?? operator for null coalescing
  • The ??= operator for null coalescing assignment
  • Cross-platform Invoke-DscResource (experimental)
  • Return of the Out-GridView cmdlet
  • Return of the -ShowWindow switch for the Get-Help

Comparison of cmdlets with similar commands

  1. ls and man aliases are absent in the Linux version of PowerShell Core.
  2. Clear-Host is implemented as a predefined PowerShell function.
  3. Available in Windows NT 4, Windows 98 Resource Kit, Windows 2000 Support Tools
  4. Introduced in Windows XP Professional Edition
  5. Also used in UNIX to send a process any signal, the “Terminate” signal is merely the default
  6. curl and wget aliases are absent from PowerShell Core, so as to not interfere with invoking similarly named native commands.
ExtensionDescription
.ps1Script file[111]
.psd1Module’s manifest file; usually comes with a script module or binary module[112]
.psm1Script module file[113]
.dllDLL-compliant[a] binary module file[114]
.ps1xmlFormat and type definitions file[49][115]
.xmlXML-compliant[b] serialized data file[116]
.psc1Console file[117]
.psscSession configuration file[118]
.psrcRole Capability file[119]
ApplicationVersionCmdletsProviderManagement GUI
Exchange Server2007402YesYes
Windows Server2008YesYesNo
Microsoft SQL Server2008YesYesNo
Microsoft SharePoint2010YesYesNo
System Center Configuration Manager2012 R2400+YesNo
System Center Operations Manager200774YesNo
System Center Virtual Machine Manager2007YesYesYes
System Center Data Protection Manager2007YesNoNo
Windows Compute Cluster Server2007YesYesNo
Microsoft Transporter Suite for Lotus Domino[120]08.02.001247NoNo
Microsoft PowerTools for Open XML[121]1.033NoNo
IBM WebSphere MQ[122]6.0.2.244NoNo
IoT Core Add-ons[123]74Un­knownUn­known
Quest Management Shell for Active Directory[124]1.795NoNo
Special Operations Software Specops Command[125]1.0YesNoYes
VMware vSphere PowerCLI[126]6.5 R1500+YesYes
Internet Information Services[127]7.054YesNo
Windows 7 Troubleshooting Center[128]6.1YesNoYes
Microsoft Deployment Toolkit[129]2010YesYesYes
NetApp PowerShell Toolkit[130][131]4.22000+YesYes
JAMS Scheduler – Job Access & Management System[132]5.052YesYes
UIAutomation[133]0.8432NoNo
Dell Equallogic[134]3.555NoNo
LOGINventory[135]5.8YesYesYes
SePSX[136]0.4.139NoNo

Как установить и обновить power shell 7. краткое руководство

Wikiversity has learning resources about PowerShell

  • PowerShell on GitHub
  • Windows PowerShell Survival Guide on TechNet Wiki

This PowerShell release includes PSReadLine enhancements, better integration with Windows Defender Application Control and new features to ease native command use for all platforms.

The release of PowerShell 7.4 is a significant milestone in the development of PowerShell.

Why PowerShell 7.4 benefits from .NET 8 and LTS

PowerShell 7.4 is the first version built on .NET 8, which is a Long Term Support (LTS) version that provides support for three years. The previous PowerShell release ran on .NET 7, which was a Standard Term Support release, offering 18 months of support.

In the world of software, if you intend to use a specific version of a product for a long time, you are best served by an LTS version. Since PowerShell 7.4 runs on .NET 8, this means that the PowerShell team intends to support it by releasing bug fixes and security updates for the length of the support term.

This gives you the confidence that writing a script for PowerShell 7.4 has support for several years to come.

What are the PSReadLine improvements in PowerShell 7.4?

Besides a beneficial support schedule, PowerShell 7.4 also comes with command-line editing improvements by including PSReadLine 2.3.4.

PowerShell 7.4 adds ProgressAction as new common parameter

PowerShell 7.4 introduced a new feature to enhance your scripting experience. The developers added as a common parameter, which is a parameter that can be used on any cmdlet because it is part of PowerShell. Because a cmdlet accepts all common parameters, that doesn’t mean that the parameter affects a cmdlet. For example, using the parameter on a cmdlet that doesn’t generate that type of output has no effect.

  • . No progress bar. Outputs an error message and stops.
  • . Prompts for permission and only displays the progress bar if the user responds with a or .
  • . The default. It shows the progress bar and runs the code.
  • . No progress bar is displayed.

How PowerShell 7.4 works with Windows Defender Application Control

Windows Defender Application Control (WDAC) restricts driver and application use on managed clients. WDAC enforces Constrained Language Mode for all PowerShell scripts. Earlier versions of PowerShell lacked the debugging functionality in Constrained Language Mode, which made scripting difficult.

:/>  Не открывается приложение на Андроиде: рассказываем что делать!

With the upgrade in PowerShell 7.4, scripts that execute in audit mode of WDAC now log additional details to the event log to describe what restrictions apply if the policy was in mode. This should make writing and debugging scripts for WDAC much easier.

Experimental features become mainstream in PowerShell 7.4

PowerShell table headers
The italicized headers distinguish the calculated property from the object property to help new PowerShell users understand the difference.

If you run a native command in PowerShell and it errors, the variable holds information about the result. gives you more control over native command failures by producing error objects that are then handled normally through the PowerShell error stream. With , native command errors respect your without any fancy scripting on your part.

# Native command piped to native command
curl -s -L $uri | tar -xzvf - -C .
# PowerShell command piped to native command
(Invoke-WebRequest $uri).Content | tar -xzvf - -C .

The variable now controls how PowerShell calls native commands so you can now pass empty strings, as well as arguments that include quotes. Previously, PowerShell constructed a string and invoked the native executable using the string, but now, PowerShell uses the property of the object. The variable automatically enables the new method with a setting of . If you prefer the traditional method of building a string, use the setting. On Windows, the default is , and this accepts invocations for several native Windows executables.

Anthony Howell is an IT expert who is well versed in multiple infrastructure and automation technologies, including PowerShell, DevOps, cloud computing, and the Windows and Linux operating systems.

Dig Deeper on IT operations and infrastructure management

Important Things Before You Update PowerShell

Before you upgrade PowerShell version, it’s necessary to know some basic information related to this subject. Here we summarize the most frequently asked questions.

What Is the Latest PowerShell Version

Since its release, Windows PowerShell has experienced several versions, including PowerShell 1.0, PowerShell 2.0, PowerShell 3.0, PowerShell 4.0, PowerShell 5.0, PowerShell 5.1, PowerShell Core 6, PowerShell 7, and PowerShell 7.2. According to the official information from Microsoft, the latest version of PowerShell is upgraded to V7.2.5 on June 21, 2022. Well, the PowerShell Preview v7.3.0 was also released in 2022.

So, what’s the latest PowerShell version for Windows 10/11? PowerShell 7.2 is the latest current version for Windows 10/11. To give you an intuitive understanding, here we summarize the most commonly used PowerShell versions that support different Windows OS:

supported Windows 0S for different PowerShell versions

What Version of PowerShell Do I Have

Step 1. Right-click the Windows Start menu at the bottom of your left screen and select Windows PowerShell.

Step 3. Scroll down to the PSVersion section and the value next to it is the current PowerShell version of your computer. As the picture shows below, the current PowerShell version is 5.1.

check PowerShell version on Windows 10

How to Update PowerShell to the Latest Version for Windows 10/11

Way 1. Update PowerShell Version Via MSI Package

If you don’t know if your system is x86 or x64 version, read this post.

install the MSI package

Step 2. Once downloaded, double click the PowerShell-7.2.5 msi installer file and click on Next.

click Next in PowerShell 7 setup wizard

Step 3. Select a destination folder for the PowerShell v7.2.5 package and click on Next. If you haven’t changed the location, the default path of the package is installed to C:ProgramFilesPowerShellversion

select Destination folder for PowerShell installation

Step 4. Select the Optional Actions and click on Next. Here you can customize the installation for PowerShell.

select Optional Actions for PowerShell installation

Step 5. PowerShell 7.2 version comes with automatic updates through the Microsoft Update service. Here you can tick the checkbox next to Enable updating PowerShell through Microsoft Update or WSUS (recommended) and click on Next.

Enable updating PowerShell through Microsoft Update or WSUS

Step 6. Click on Install and then on Yes in the UAC window to start installing the latest PowerShell version 7.2.5.

=installing PowerShell 7 in Windows 10

Step 7. Once installed, you can click on Finish or launch the latest PowerShell version 7.2.5 later.

=click Finish on PowerShell 7 installation wizard

Step 8. If you want to start the latest PowerShell version, type powershell in the Search box and select PowerShell 7 (x64). Then you can run the $PSversionTable command and check if the PowerShell version is v7.2.5.

=run PowerShell 7

Way 2. Update PowerShell Version Via Microsoft Store

Another simple way about how to upgrade PowerShell is to use Microsoft Store. Now, the latest PowerShell version 7.2.5 can be installed from the Store. Here’s how to install it.

Step 1. Open Microsoft Store on your computer, and then type powershell in the search box and select PowerShell from the listed results.

Step 2. Once the latest PowerShell version package appears, click on Get and wait for the installation to complete.

=download PowerShell from Microsoft Store

Step 3. Once installed, click on Open and the PowerShell 7.2.5 x64 pwsh.exe window will be shown as the picture below:

=open PowerShell window via Microsoft Store

What’s the latest PowerShell version for Windows 10/11? How to upgrade PowerShell? Now, I believe that you already have known the answers.