Files - Previewを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id FilesCommunity.FilesPreview -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id FilesCommunity.FilesPreview -e --silentwinget uninstall --id FilesCommunity.FilesPreview -e --silentインストーラー別
64ビット · MSIX
サイレントインストール
Add-AppxPackage -Path Files.Package_4.2.9.0_x64_arm64.msixbundleアンインストール
Get-AppxPackage -Name FilesPreview | Remove-AppxPackageARM64 · MSIX
サイレントインストール
Add-AppxPackage -Path Files.Package_4.2.9.0_x64_arm64.msixbundleアンインストール
Get-AppxPackage -Name FilesPreview | Remove-AppxPackagePowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-files-preview.ps1
$url = 'https://cdn.files.community/files/preview/Files.Package_4.2.9.0_Test/Files.Package_4.2.9.0_x64_arm64.msixbundle'
$sha256 = '43B48C8D4D6EBEB15C8810317407FC239CA4A945424435071DF734F96BBBA6EE'
$file = Join-Path $env:TEMP 'Files.Package_4.2.9.0_x64_arm64.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file install-files-preview.ps1
$url = 'https://cdn.files.community/files/preview/Files.Package_4.2.9.0_Test/Files.Package_4.2.9.0_x64_arm64.msixbundle'
$sha256 = '43B48C8D4D6EBEB15C8810317407FC239CA4A945424435071DF734F96BBBA6EE'
$file = Join-Path $env:TEMP 'Files.Package_4.2.9.0_x64_arm64.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file