好记性不如烂笔头。

Windows安装OpenSSH

```

# Download OpenSSH
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/latest/'
$request = [System.Net.WebRequest]::Create($url)
$request.AllowAutoRedirect=$false
$response=$request.GetResponse()
$uri = $([String]$response.GetResponseHeader("Location")).Replace('tag','download') + '/OpenSSH-Win64.zip'
Invoke-WebRequest -Uri $uri -OutFile OpenSSH-Win64.zip

# SymbolicLink
New-Item -ItemType SymbolicLink -Path "C:\pwsh" -Target "C:\Program Files\PowerShell\6"

# Expand archive
Expand-Archive .\OpenSSH-Win64.zip "C:\Program Files\"
Rename-Item "C:\Program Files\OpenSSH-Win64" "C:\Program Files\OpenSSH"

#Install OpenSSH
& "C:\Program Files\OpenSSH\install-sshd.ps1"
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Set-Service sshd -StartupType Automatic
Start-Service sshd

```