Windows: 使用Windows包管理器。Winget
winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell --source winget
debian:
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
sudo apt-get update
安装后要注意切换,他的名字 直接叫 PowerShell, 不带微软前缀
winget list --id Microsoft.PowerShell --upgrade-available
winget upgrade --id Microsoft.PowerShell
https://docs.chocolatey.org/en-us/choco/setup/
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('<https://community.chocolatey.org/install.ps1>'))
choco /?
Windows (PS)启用脚本运行
Get-ExecutionPolicy
set-ExecutionPolicy RemoteSigned
WSL
Windows旧版本(23H2就算了),安装WSL 参考https://learn.microsoft.com/zh-cn/windows/wsl/install-manual 启动Windows 功能