PowerShell is powerful command line interface for windows PCs and servers, it does get installed by default when you install windows on a PC or server. However, if you want the most up to date version of PowerShell, it is up to you to install it manually.
Following article is based on Windows 10 PC so some version numbers might be different on different version of Windows.
The PowerShell version you get when you install Windows is called "Desktop Edition". You can see this by running $PSVersionTable command on PowerShell:
As you can see version of this edition of PowerShell is 5.1.xxx.
But there is another Edition written on .Net Core and it is currently on 7.4.xx.This version is much more sophisticated and have ability to integrate with more modern development environments. There fore if you are a software developer or person who manage modern tools/software, I recommend using this edition of PowerShell.
So let's see how we can install this edition.
Microsoft has comprehensive article on how to install PowerShell in here. Following is simplified version of it.
There are few ways to install PowerShell.
- Using Winget
- Using MSI package
- Using .NET Global Tool
- Using Microsoft Store
Using Winget
If you not already aware, winget is the Windows Package Manager. You can run following command on command line (or even default edition of PowerShell) to install via winget:
winget install --id Microsoft.PowerShell --source winget
Using MSI package
This is more traditional way of installing. You will have to manually download it and install it.
Following is the link to the current version of the MSI package -> MSI
This will download the MSI package from GitHub and you will need to save it and run it (note above is x64 version, if you need different version please search for it).
MSI package does give more control over the installation. You can specify various options while installing it. For more information please refer to the original Microsoft article mentioned above.
Using .NET Global Tool
If you have .NET Core SDK already installed on your computer, you can install PowerShell as .NET Global Tool (can invoke from any directory).
Just run following command on command line:
dotnet tool install --global PowerShell
Using Microsoft Store
Like any other application on Microsoft store, PowerShell can be installed from Microsoft Store.
No comments:
Post a Comment