Kommandon för att installera GnuWin32: Grep utan frågor, ta bort programmet igen och identifiera det i distributionsverktyg. Ett kommando visas bara när det är säkert: från manifestet eller som installationsteknikens dokumenterade standard.
Relaterad guide: Parametrar för tyst installation: MSI, NSIS, Inno · Avinstallera program via registret eller PowerShell
Med winget
PowerShell
winget install --id GnuWin32.Grep -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GnuWin32.Grep -e --silentwinget uninstall --id GnuWin32.Grep -e --silentPer installationsfil
32-bitars · EXE (Inno Setup)
Tyst installation
download /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Egen mapp
download /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\gnuwin32-grep"PowerShell: ladda ner, kontrollera, installera
Laddar ner den officiella filen, kontrollerar dess SHA256 och installerar tyst.
install-gnuwin32-grep.ps1
$url = 'https://sourceforge.net/projects/gnuwin32/files/grep/2.5.4/grep-2.5.4-setup.exe/download'
$sha256 = '5265DA018B2213AB5446616F0837F82ADA4196FFC16434C4319C6679E2942D06'
$file = Join-Path $env:TEMP 'download'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait