$ErrorActionPreference = 'Stop'; # stop on all errors $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $url = 'https://e-sword.net/files/e-sword_1201_setup.exe' # download url, HTTPS preferred $packageArgs = @{ packageName = $env:ChocolateyPackageName unzipLocation = $toolsDir fileType = 'EXE' url = $url softwareName = 'e-Sword' checksum = 'CF4C433DA2291236A803E27648C8C0B4B88DF396D9814A24FB16478B3DBEAD50' checksumType = 'sha256' validExitCodes= @(0, 3010, 1641) silentArgs = '/s /v"/qn"' } Install-ChocolateyPackage @packageArgs # https://chocolatey.org/docs/helpers-install-chocolatey-package