PowerShell is an amazing tool created by Microsoft so you can automate tasks. By knowing which PowerShell version you have access to, you will know what features you can use. There are more than 200 commands that can be used within PowerShell and it is a super flexible framework that will save you a bunch of time.
Can you use PowerShell only on your Windows computer?
Since 2016 PowerShell was announced as open-source and cross-platform. You can use it on macOS and Linux too. Although it is native to Windows OS, and Microsoft only supports security updates and bug fixes, PowerShell Core is being worked on to clear these issues with other OS.
Why is it important to know which PowerShell version you are running?
PowerShell had many versions during the year starting with version 1.0 back in 2006. The newest version( version 7) comes with the following new features:
- Parallel processing with the Parallel switch for the ForEach-Object cmdlet
- A new error-view and Get-Error cmdlet
- Compatibility with native Windows modules
- Ternary operation with the?: operator and null coalescing with the ?? operator
We are saying all this, so you can know that not all PowerShell versions are the same. A lot of people need assistance when they try to figure out what PowerShell version they are running. Therefore we created this small guide with all the ways you can check.
How to check what PowerShell version I have installed?
First, you need to open PowerShell. Simply open the Windows Start Menu and type in the search bar PowerShell, and click on the app.
You will see a window, where you enter the following command $PSVersionTable.PSVersion, and hit Enter. In the screenshot below you can see an example where you can find the version.
Another method that you can use to check what PowerShell version you are running is to use the command “Get-Host”
The last method we will show you is by using the command “$host.version”. You will see the PowerShell version in a slightly different format. You will be able to see the Major and Minor release and the build number and revision.
How can I upgrade to a newer version of PowerShell?
You can run both Windows PowerShell and PowerShell 7.2 on the same computer. You do not have to worry about the lack of feature parity by upgrading. Simply keep the current Windows PowerShell installed and also download PowerShell. You can do that by going to its GitHub release page. You will see a list of assets, where you can simply choose the OS you want to download for.
Overall PowerShell can help you with automating some of the tasks that you are doing on regular basis on your PC. By knowing which version you are running and how to upgrade it you will be able to utilize it without any issues.