1. Press the Win key + R key to open the Run window, enter "CMD", and then press Enter to open the CMD window.#
2. Copy and paste the installation code and press Enter#
winget search Microsoft.PowerShell
2.2. After entering Y to agree to the terms, the following content will appear#
Name Id Version Source
--------------------------------------------------------------
PowerShell Microsoft.PowerShell 7.3.4.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.4.1.0 winget
2.3. Install PowerShell or PowerShell Preview using the id parameter#
Here we will install the regular version of PowerShell
winget install --id Microsoft.Powershell --source winget
Start installing PowerShell after copying and pasting the code.