- 搜索“可选功能” > “OpenSSH”,确保 OpenSSH Server 和 Client 已安装。
- 搜索并打开“服务”
- 往下拉找到 OpenSSH Server,双击点开,弹出一个窗口。
- 启动类型选择“自动”,然后服务状态下面点击启动。
Windows Learn | Get started with OpenSSH for Windows
如果 Windows 没有自带 winget,那么去微软应用商店搜索“应用安装程序”(App Installer)。
winget install --id Microsoft.PowerShell --source wingetWindows Learn | OpenSSH Server configuration for Windows Server and Windows
以管理员权限运行一个 PowerShell session,然后运行以下命令:
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" `
-Name "DefaultShell" `
-Value "$(Get-Command pwsh).Path" `
-PropertyType String -Force(get-command pwsh).path
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
C:\Program Files\PowerShell\7\pwsh.exe
// The path of Microsoft Store installed pwsh
C:\Program Files\WindowsApps\Microsoft.PowerShell_7.5.4.0_x64__8wekyb3d8bbwe\pwsh.exe$PSVersionTable
Name Value
---- -----
PSVersion 7.6.1
PSEdition Core <=== indicates pwsh
GitCommitId 7.6.1
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0如果以上 PSEdition 显示为 Core 那么就是 ~pwsh~;如果显示为 =Desktop=,那么就是 Windows PowerShell(powershell.exe)。
By default, PowerShell uses Windows-style keybindings (similar to Notepad). To get Emacs/Bash-style navigation (Ctrl-a, Ctrl-e, Alt-f, etc.), enable Emacs mode via PSReadLine:
Set-PSReadLineOption -EditMode EmacsTo make this permanent, add it to your PowerShell profile. The command below creates the profile file if it doesn’t exist, then appends the setting:
if (!(Test-Path (Split-Path $PROFILE))) {
New-Item -ItemType Directory -Path (Split-Path $PROFILE) -Force
};
if (!(Test-Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
};
Add-Content -Path $PROFILE -Value 'Set-PSReadLineOption -EditMode Emacs';
. $PROFILETo learn more about PSReadLine options:
Get-Help -Name Set-PSReadLineOptionSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expressionscoop install cwrsync btopExport apps list from a working Windows machine:
winget export -o apps.json
winget export -o apps.json --source wingetInstall apps from the app list file:
winget import -i apps.jsonManually install apps one by one:
winget install --id Notion.Notion --source winget
winget install --id ByteDance.Feishu --source winget
winget install FeishuRecommended way to install applications on Windows from Terminal:
- https://learn.microsoft.com/en-us/devops/develop/git/install-and-set-up-git
- https://git-scm.com/install/windows
winget install --id Git.Git -e --source wingethttps://github.com/Raphire/Win11Debloat
- Open PowerShell or Terminal, preferably as an administrator.
- Copy and paste the command below into PowerShell:
& ([scriptblock]::Create((irm "https://debloat.raphi.re/")))- Wait for the script to automatically download Win11Debloat.
- Carefully read through and follow the on-screen instructions.