修改 Powershell 7 默认编码为 UTF-8

此教程是为了解决在使用 AI Coding 时候, 读取项目文件提示代码乱码问题. 以下内容只修改 pwsh 默认编码问题, Vscode, Pycharm 等 IDE. 需要手动修改默认 powershell 为 7.x 版本, 否则默认还是 5.x 版本. 安装 Powershell 7 查看当前 Powershell 版本 $PSVersionTable 输出如下 PSVersion 7.5.4 如果使用的是 Powershell 5.x 建议升级到 Powershell 7.x, 对 UTF-8 支持会更好. 搜索最新版本的 PowerShell winget search --id Microsoft.PowerShell 输出如下 Name Id Version Source --------------------------------------------------------------- PowerShell Microsoft.PowerShell 7.5.4.0 winget PowerShell Preview Microsoft.PowerShell.Preview 7.6.0.6 winget 使用 --id 参数安装 PowerShell 或 PowerShell 预览版 winget install --id Microsoft.PowerShell --source winget winget install --id Microsoft.PowerShell.Preview --source winget 打开 pwsh 查看默认编码, 注意 powershell 指令默认打开为 5.x 版本, pwsh 打开为 7.x 版本 chcp 如果输出不是为 65001 就不是 UTF-8 编码 ...

2026-02-10 · Last Updated 2026-02-10 · Commit 8adfacb · map[name:kaish]

Windows 安装 SSH 服务端

安装 下载 OpenSSH 以管理员身份打开 PowerShell 并进入 OpenSSH 目录 允许 PowerShell 脚本执行 Set-ExecutionPolicy Bypass -Scope Process -Force 运行安装脚本, 注册 SSH 服务端. .\install-sshd.ps1 启动服务 Start-Service sshd 开机自启 Set-Service sshd -StartupType Automatic 查看服务 Get-Service sshd 放行端口 New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Port 22" ` -Protocol TCP -Direction Inbound -LocalPort 22 -Action Allow 测试, 必须要有密码, Windows 不允许空密码 ssh Administrator@IP 卸载 停止服务 Stop-Service sshd Stop-Service ssh-agent 卸载服务 .\uninstall-sshd.ps1 删除 OpenSSH 文件夹 检查 Get-Service sshd 返回以下内容 ...

2025-12-03 · Last Updated 2026-01-28 · Commit a2ee08d · map[name:kaish]