Skip to content

Instantly share code, notes, and snippets.

@steviecoaster
Last active August 23, 2022 15:12
Show Gist options
  • Save steviecoaster/e318729b7c468a3a6b0f8dcbe0b13fb1 to your computer and use it in GitHub Desktop.
Save steviecoaster/e318729b7c468a3a6b0f8dcbe0b13fb1 to your computer and use it in GitHub Desktop.
large package example
$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://server:8443/repository/choco-install/npp.7.9.3.Installer.x64.zip'
$zipChecksum = 'c3a5c0d10747f80d0e60767b92a8ee4e8f0bdc5067b8747368fcf322926f887c'
$zipArgs = @{
PackageName = $env:ChocolateyPackageName
url = $url
unzipLocation = $toolsDir
checksum = $zipChecksum
checksumType = 'SHA256'
}
Install-ChocolateyZipPackage @zipArgs
$fileLocation = Join-Path $toolsDir 'npp.7.9.3.Installer.x64.exe'
$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'EXE'
file = $fileLocation
softwareName = 'notepad*'
checksum = '942A5FA284DF6018AEC19110B0D9E68742194BFD44DD984B515ADF103D99775A'
checksumType = 'sha256'
silentArgs = "/S"
validExitCodes= @(0)
useOriginalLocation = $true
}
Install-ChocolateyInstallPackage @packageArgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment