Windows
更新时间 2026-07-02 16:12:17
最近更新时间: 2026-07-02 16:12:17
本文介绍如何在 Windows 上安装天翼云 CLI。用户侧只推荐两种方式:
一键部署:脚本自动识别 amd64 或 arm64 架构并安装。
下载 setup 包自行安装:先确认架构,再下载匹配的 zip 包。
安装完成后,在 PowerShell 中执行:
ctyun-cli1. 一键安装
打开 PowerShell,安装最新版本天翼云CLI:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -UseBasicParsing "https://huabei-2.zos.ctyun.cn/ctyun-cli/install-cli.ps1" -OutFile install-cli.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-cli.ps1 -BaseUrl "https://huabei-2.zos.ctyun.cn/ctyun-cli"下载指定版本天翼云CLI:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -UseBasicParsing "https://huabei-2.zos.ctyun.cn/ctyun-cli/install-cli.ps1" -OutFile install-cli.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-cli.ps1 -BaseUrl "https://huabei-2.zos.ctyun.cn/ctyun-cli" -Version v0.1.0执行后,CLI会安装到以下目录,并将该目录写入当前用户的 PATH:
%USERPROFILE%\.ctyun-cli\bin\ctyun-cli.exe如果 PowerShell 提示不允许执行脚本,可以只为当前窗口临时放开限制:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass然后重新执行安装命令。该设置只影响当前 PowerShell 窗口。
2. 手动安装
确认系统和架构
$env:PROCESSOR_ARCHITECTURE架构对应关系:
输出 | 包名字段 | 安装包 |
|---|---|---|
AMD64 / X64 | amd64 | ctyun-cli-windows-amd64-setup.zip |
| ARM64 | arm64 | ctyun-cli-windows-arm64-setup.zip |
解压后,执行压缩包内的脚本:
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-cli.ps1默认会安装到:
%USERPROFILE%\.ctyun-cli\bin\ctyun-cli.exe3. 验证安装结果
安装完成后执行:
ctyun-cli version
ctyun-cli --help如果当前 PowerShell 还找不到命令,先直接验证文件:
& "$HOME\.ctyun-cli\bin\ctyun-cli.exe" version如果可以运行,关闭并重新打开 PowerShell,或在当前窗口临时加入 PATH:
$env:Path = "$HOME\.ctyun-cli\bin;$env:Path"
ctyun-cli version