开始使用
Winenv 支持 Windows 11。首次安装只需要普通 PowerShell、网络连接,以及 Windows 11 通常随 App Installer 提供的 WinGet。
打开普通 PowerShell,执行:
irm https://raw.githubusercontent.com/YangYuS8/winenv/main/install.ps1 | iex安装器会自动完成以下工作:
- 从 GitHub Releases 获取最新稳定版;
- 下载版本 ZIP 和
SHA256SUMS并校验 SHA-256; - 安装到
%LOCALAPPDATA%\Winenv\versions; - 创建全局短命令
win; - 探测 PowerShell 7、fzf 和 mise 的真实路径及版本,兼容时直接复用;
- 只为缺失的运行能力安装内置 Profile 声明的默认包。
安装结束后新开一个 PowerShell 窗口:
win checkwin英文是项目的权威语言。第一次运行时,Winenv 会读取当前 Windows UI culture:zh-* 自动使用简体中文,其余语言使用英文。
win lang # 查看当前语言及其来源win lang en # 持久使用英文win lang zh # 持久使用简体中文win lang auto # 恢复系统自动检测单次执行可以使用 -Lang en、-Lang zh 或 -Lang auto。WINENV_LANG 环境变量可为当前终端或自动化设置默认值;明确传入的 -Lang 优先级最高。
安装时也可以直接选择语言:
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/YangYuS8/winenv/main/install.ps1))) -Lang zhWinGet 不可用时
Section titled “WinGet 不可用时”WinGet 是 Windows 侧的基础安装通道。找不到 winget.exe 时,安装器会先尝试重新注册 Windows 11 自带的 App Installer;仍不可用则停止,并给出 Microsoft Store 和官方修复方向。
Winenv 不会静默提权,也不会为了补 WinGet 擅自安装 PowerShell Gallery 模块。
安装时导入自己的 Profile
Section titled “安装时导入自己的 Profile”可以从本地文件或 HTTPS 链接导入:
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/YangYuS8/winenv/main/install.ps1))) -UserProfile C:\Users\me\my-winenv.json
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/YangYuS8/winenv/main/install.ps1))) -UserProfile https://example.com/my-winenv.jsonProfile 会作为独立的一层加入,不会覆盖内置运行层或其他用户 Profile。详见组合 Profile。
只安装 Winenv
Section titled “只安装 Winenv”想先获得 win 命令、不立即安装 Profile 中的软件:
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/YangYuS8/winenv/main/install.ps1))) -ToolOnly之后可随时执行 win add 应用当前 Profile。
安装指定版本
Section titled “安装指定版本”& ([scriptblock]::Create((irm https://raw.githubusercontent.com/YangYuS8/winenv/main/install.ps1))) -Version 0.13.0不指定 -Version 时始终安装最新稳定 Release;日常执行 win up 会先更新 Winenv 自身。
- 新电脑:直接查找与管理软件。
- 已经使用一段时间的电脑:先扫描并接入现有系统。
- 有自己的软件基线:创建或导入用户 Profile。
