This post will show you how to install PowerShell 7 with Winget on Windows 11. If you are not familiar with it, PowerShell is Microsoft’s task automation framework and scripting language.
It provides an interactive command-line interface for managing the system, but it also includes a powerful scripting environment that can be used to control both local or remote systems through its rich object model; this makes it easy for people who want to do more than just work at the keyboard!
Let’s start and first search for PowerShell 7 using the Winget search command, which will show the latest PowerShell 7 stable and preview version using the command below.
If you like, you can install both versions, and they will work side by side. For production purposes, I would not recommend using the preview version.
winget search microsoft.powershell
The following command will install PowerShell 7 in silent mode without any prompts or confirmation from the user. This is my favourite option, and it is also handy if you are using automation toll to deploy it to users.
winget install microsoft.powershell --silent --accept-package-agreements --accept-source-agreements
After the installation is completed, you can go ahead and start using PowerShell 7.