Code Notesを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id lauthieb.code-notes -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id lauthieb.code-notes -e --silentwinget uninstall --id lauthieb.code-notes -e --silentインストーラー別
64ビット · EXE(NSIS) · 現在のユーザー
サイレントインストール
code-notes-1.2.4.exe /Sインストール先を指定
code-notes-1.2.4.exe /S /D=C:\Apps\code-notesPowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-code-notes.ps1
$url = 'https://github.com/lauthieb/code-notes/releases/download/1.2.4/code-notes-1.2.4.exe'
$sha256 = '14371CBDD7E406D6946E2E7912739FAE032DBE4E40B83A9ED8B6A9D93DC2F567'
$file = Join-Path $env:TEMP 'code-notes-1.2.4.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S' -Wait