Windows PowerShell gets better all the time and Microsoft offers a major new release about every three years. Here are all of the things you need to know about the version of PowerShell.
Command To Show Current Version of PowerShell
You can use the following command in PowerShell to display the current version:
$PSVersionTable.PSVersion
This command will return an object that includes the major, minor, build, and revision numbers of the PowerShell engine. For example, if you’re running PowerShell 5.1, the output will look something like this:
Major Minor Build Revision
----- ----- ----- --------
5 1 14393 2828
This indicates that the major version is 5, the minor version is 1, the build number is 14393, and the revision number is 2828.
What Version of PowerShell Can Windows Be Upgraded To
Operating System | Shipped PowerShell Version | Highest Upgradable Version |
Windows 7 | PowerShell 2.0 | PowerShell 5.11 |
Windows 8 | PowerShell 3.0 | PowerShell 5.12 |
Windows 8.1 | PowerShell 4.0 | PowerShell 5.13 |
Windows 10 | PowerShell 5.0 | PowerShell 7.4.14 |
Windows 11 | PowerShell 5.1 | PowerShell 7.4.14 |
Windows 11 23H2 | PowerShell 5.1.22 | PowerShell 7.4.14 |
Server 2008 R2 | PowerShell 2.0 | PowerShell 5.13 |
Server 2012 | PowerShell 3.0 | PowerShell 5.12 |
Server 2012 R2 | PowerShell 4.0 | PowerShell 5.13 |
Server 2016 | PowerShell 5.1 | TBD – At Least PowerShell 7.4.14 |
Server 2019 | PowerShell 5.1 | TBD – At Least PowerShell 7.4.14 |
Server 2022 | PowerShell 7.0 | TBD – At Least PowerShell 7.4.14 |
Server 2025 | PowerShell 7.4 | TBD – At Least PowerShell 8 |
Command To Upgrade PowerShell Versions
To search for the latest version of PowerShell:
winget search Microsoft.PowerShell
To install the latest stable version of PowerShell:
winget install --id Microsoft.Powershell --source winget
To install the latest preview version of PowerShell:
winget install --id Microsoft.Powershell.Preview --source winget
Most Important New Features In Each Version of PowerShell
Here are the two most notable new features in each new major version of PowerShell:
- PowerShell 2.0:
- Remoting: This feature allows you to run commands on one or more remote computers from a single computer that is also running Windows PowerShell.
- New Cmdlets: PowerShell 2.0 introduces over 100 built-in cmdlets.
- PowerShell 3.0:
- Workflow: This feature allows long-running tasks to be managed as single tasks.
- Show-Command: A cmdlet that provides a graphical user interface for cmdlets.
- PowerShell 4.0:
- Desired State Configuration (DSC): This feature allows you to declare and manage the configuration of your systems.
- Windows PowerShell Web Access: This feature allows you to run PowerShell commands and scripts in a web-based console.
- PowerShell 5.0:
- Classes: This feature allows you to define classes in your scripts.
- PowerShellGet: This module allows you to download and install modules from the PowerShell Gallery.
- PowerShell 5.1:
- Local Users and Groups Cmdlets: These cmdlets allow you to manage local users and groups.
- Get-ComputerInfo Cmdlet: This cmdlet allows you to get a consolidated object of system and operating system properties.
- PowerShell 6.0:
- Cross-Platform Support: PowerShell 6.0 is a new edition of PowerShell that is cross-platform (Windows, macOS, and Linux), open-source, and built for heterogeneous environments and the hybrid cloud.
- SSH-Based Remoting: This feature allows you to establish remote sessions between different operating systems.
- PowerShell 7.0:
- Pipeline Parallelization: This feature allows you to execute or handle objects in parallel instead of the sequence method when using ForEach-Object -Parallel.
- New Operators: PowerShell 7.0 introduces several new operators including ternary operator, pipeline chain operators, and null coalescing operators.
- PowerShell 7.1:
- Built on .NET Core 5.0: PowerShell 7.1 is built on .NET Core 5.0, which includes several core module updates.
- PSReadLine 2.1.0: This version includes predictive IntelliSense, which is a fish shell-like syntax prediction engine.
- PowerShell 7.4:
- Updated versions of PSResourceGet and PSReadLine: PowerShell 7.4 includes Microsoft.PowerShell.PSResourceGet v1.0.1. This module is installed side-by-side with PowerShellGet v2.2.5 and PackageManagement v1.4.8.1.
- Tab completion improvements: There have been several improvements to tab completion, thanks to contributions from the community. These improvements include fixing issues when completing the first command in a script with an empty array expression, improving positional argument completion, prioritizing the default parameter set when completing positional arguments, and more.
0 Comments