免互動安裝Oracle Cloud Infrastructure CLI、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Oracle.OCI-CLI -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Oracle.OCI-CLI -e --silentwinget uninstall --id Oracle.OCI-CLI -e --silent依安裝檔
64位元 · MSI
靜默安裝
msiexec /i oci-cli-3.95.0-Windows-Server-Installer.msi /qn /norestart寫入記錄檔
msiexec /i oci-cli-3.95.0-Windows-Server-Installer.msi /qn /norestart /l*v "%TEMP%\oracle-cloud-infrastructure-cli-install.log"解除安裝
msiexec /x {7C4749BB-5F03-4AE5-9B6C-E8DBC0036EFB} /qn /norestart- MSI產品代碼
- {7C4749BB-5F03-4AE5-9B6C-E8DBC0036EFB}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7C4749BB-5F03-4AE5-9B6C-E8DBC0036EFB}
- UpgradeCode
- {48B079F4-B598-438D-A62A-8A233A3F8901}
- 安裝資料夾
- Lib
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-oracle-cloud-infrastructure-cli.ps1
$url = 'https://github.com/oracle/oci-cli/releases/download/v3.95.0/oci-cli-3.95.0-Windows-Server-Installer.msi'
$sha256 = '1A1BC73DAB9F84480D6404DDD266496B357C944D2AED7CCB1FEF9AC3F698CC91'
$file = Join-Path $env:TEMP 'oci-cli-3.95.0-Windows-Server-Installer.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait