winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell --source winget
winget install --id Microsoft.Powershell.Preview --source winget
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell
pwsh
Download .deb file from GitHub, then...
sudo dpkg -i powershell-lts_7.3.6-1.deb_amd64.deb
sudo apt-get install -f
To resolve missing dependencies and finish the install (if necessary)PS C:\Windows\system32> winget search --id Microsoft.PowerShell
winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ winget search --id Microsoft.PowerShell
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (winget:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
You're missing App Installer (Microsoft Store package)
OR you’re using a Windows Server build that doesn’t ship winget by default
OR App Installer is installed but its PATH is broken
Check if App Installer is installed...
Get-AppxPackage Microsoft.DesktopAppInstaller
If nothing is returned then App Installer is not installedTo install App Installer...
It is not recommended to do this on Windows Server (even though it may work)Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Winget.msixbundle
Add-AppxPackage .\Winget.msixbundle