I comandi per installare GitHub CLI senza richieste, rimuoverlo e rilevarlo dagli strumenti di distribuzione. Un comando compare solo quando è certo: preso dal manifest o dal valore predefinito documentato della tecnologia di installazione.
Guida correlata: Installazione silenziosa: MSI, NSIS, Inno Setup · Disinstallare programmi dal registro o con PowerShell
Con winget
PowerShell
winget install --id GitHub.cli -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GitHub.cli -e --silentwinget uninstall --id GitHub.cli -e --silentPer installer
64 bit · MSI · Tutti gli utenti
Installazione silenziosa
msiexec /i gh_2.103.3_windows_amd64.msi /qn /norestartScrivi un log
msiexec /i gh_2.103.3_windows_amd64.msi /qn /norestart /l*v "%TEMP%\github-cli-install.log"Disinstallazione
msiexec /x {8B5049E4-77C4-4637-825C-77C6C1080778} /qn /norestart- Codice prodotto MSI
- {8B5049E4-77C4-4637-825C-77C6C1080778}
- Chiave di registro di disinstallazione
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8B5049E4-77C4-4637-825C-77C6C1080778}
- UpgradeCode
- {8CFB9531-B959-4E1B-AA2E-4AF0FFCC4AF4}
- Cartella di installazione
- %ProgramFiles%\GitHub CLI
64 bit · ZIP
Non richiede installazione (portable)
ARM64 · MSI · Tutti gli utenti
Installazione silenziosa
msiexec /i gh_2.103.3_windows_arm64.msi /qn /norestartScrivi un log
msiexec /i gh_2.103.3_windows_arm64.msi /qn /norestart /l*v "%TEMP%\github-cli-install.log"Disinstallazione
msiexec /x {356C78A3-D8F8-486A-B686-217AFBC67511} /qn /norestart- Codice prodotto MSI
- {356C78A3-D8F8-486A-B686-217AFBC67511}
- Chiave di registro di disinstallazione
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{356C78A3-D8F8-486A-B686-217AFBC67511}
- UpgradeCode
- {5D15E95C-F979-41B0-826C-C33C8CB5A7EB}
- Cartella di installazione
- %ProgramFiles%\GitHub CLI
ARM64 · ZIP
Non richiede installazione (portable)
32 bit · MSI · Tutti gli utenti
Installazione silenziosa
msiexec /i gh_2.103.3_windows_386.msi /qn /norestartScrivi un log
msiexec /i gh_2.103.3_windows_386.msi /qn /norestart /l*v "%TEMP%\github-cli-install.log"Disinstallazione
msiexec /x {2643C99A-0858-411A-BD5A-BBF06DC0EF78} /qn /norestart- Codice prodotto MSI
- {2643C99A-0858-411A-BD5A-BBF06DC0EF78}
- Chiave di registro di disinstallazione
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2643C99A-0858-411A-BD5A-BBF06DC0EF78}
- UpgradeCode
- {767EC5D2-C8F0-4912-9901-45E21F59A284}
- Cartella di installazione
- %ProgramFiles(x86)%\GitHub CLI
32 bit · ZIP
Non richiede installazione (portable)
PowerShell: scarica, verifica, installa
Scarica il file ufficiale, ne verifica l’hash SHA256 e lo installa in modo silenzioso.
install-github-cli.ps1
$url = 'https://github.com/cli/cli/releases/download/v2.103.3/gh_2.103.3_windows_amd64.msi'
$sha256 = '5073112B7ABB5FFBBA24B76AEE7E89269AF531218C0A42751F5F0BFB6440C2CC'
$file = Join-Path $env:TEMP 'gh_2.103.3_windows_amd64.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 install-github-cli.ps1
$url = 'https://github.com/cli/cli/releases/download/v2.103.3/gh_2.103.3_windows_arm64.msi'
$sha256 = '751F6CD2DAFFF9340822BF10C910F6DAEC3896638C030FCC8DDA8822129E4780'
$file = Join-Path $env:TEMP 'gh_2.103.3_windows_arm64.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 install-github-cli.ps1
$url = 'https://github.com/cli/cli/releases/download/v2.103.3/gh_2.103.3_windows_386.msi'
$sha256 = 'B98702030EF20FA21F17675A8D67C4343C284C69AC6D42C418806999B80C7FE5'
$file = Join-Path $env:TEMP 'gh_2.103.3_windows_386.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