NOTE: Administrative Access Required.

Installs software into "Programs and Features". Use
Install-ChocolateyPackage when software must be downloaded first.


Install-ChocolateyInstallPackage `
  -PackageName <String> `
  [-FileType <String>] `
  [-SilentArgs <String[]>] `
  -File <String> `
  [-ValidExitCodes <Object>] `
  [-UseOnlyPackageSilentArguments] `
  [-IgnoredArguments <Object[]>] [<CommonParameters>]


This will run an installer (local file) on your machine.


This command will assert UAC/Admin privileges on the machine.

If you are embedding files into a package, ensure that you have the
rights to redistribute those files if you are sharing this package
publicly (like on the community feed). Otherwise, please use
Install-ChocolateyPackage to download those resources from their
official distribution points.

This is a native installer wrapper function. A "true" package will
contain all the run time files and not an installer. That could come
pre-zipped and require unzipping in a PowerShell script. Chocolatey
works best when the packages contain the software it is managing. Most
software in the Windows world comes as installers and Chocolatey
understands how to work with that, hence this wrapper function.





$packageName= 'bob'
$toolsDir   = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
$fileLocation = Join-Path $toolsDir 'INSTALLER_EMBEDDED_IN_PACKAGE'

$packageArgs = @{
  packageName   = $packageName
  fileType      = 'msi'
  file          = $fileLocation
  silentArgs    = "/qn /norestart"
  validExitCodes= @(0, 3010, 1641)
  softwareName  = 'Bob*'

Install-ChocolateyInstallPackage @packageArgs


$packageArgs = @{
  packageName   = 'bob'
  fileType      = 'exe'
  file          = '\\SHARE_LOCATION\to\INSTALLER_FILE'
  silentArgs    = "/S"
  validExitCodes= @(0)
  softwareName  = 'Bob*'

Install-ChocolateyInstallPackage @packageArgs


Install-ChocolateyInstallPackage 'bob' 'exe' '/S' "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\bob.exe"


Install-ChocolateyInstallPackage -PackageName 'bob' -FileType 'exe' `
  -SilentArgs '/S' `
  -File "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\bob.exe" `
  -ValidExitCodes = @(0)






-PackageName <String>

The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.

Property Value
Required? true
Position? 1
Default Value
Accept Pipeline Input? false

-FileType [<String>]

This is the extension of the file. This can be "˜exe', "˜msi', or "˜msu'.
Licensed editions of Chocolatey use this to automatically determine
silent arguments. If this is not provided, Chocolatey will
automatically determine this using the downloaded file's extension.

Property Value
Aliases installerType, installType
Required? false
Position? 2
Default Value exe
Accept Pipeline Input? false

-SilentArgs [<String[]>]

OPTIONAL - These are the parameters to pass to the native installer,
including any arguments to make the installer silent/unattended.
Pro/Business Editions of Chocolatey will automatically determine the
installer type and merge the arguments with what is provided here.

Try any of the to get the silent installer -
/s /S /q /Q /quiet /silent /SILENT /VERYSILENT. With msi it is always
/quiet. Please pass it in still but it will be overridden by
Chocolatey to /quiet. If you don't pass anything it could invoke the
installer with out any arguments. That means a nonsilent installer.

Please include the notSilent tag in your Chocolatey package if you
are not setting up a silent/unattended package. Please note that if you
are submitting to the community repository, it is nearly a requirement
for the package to be completely unattended.

Property Value
Required? false
Position? 3
Default Value
Accept Pipeline Input? false

-File <String>

Full file path to native installer to run. If embedding in the package,
you can get it to the path with
"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"

In 0.10.1+, FileFullPath is an alias for File.

Property Value
Aliases fileFullPath
Required? true
Position? 4
Default Value
Accept Pipeline Input? false

-ValidExitCodes [<Object>]

Array of exit codes indicating success. Defaults to @(0).

Property Value
Required? false
Position? named
Default Value @(0)
Accept Pipeline Input? false


Do not allow choco to provide/merge additional silent arguments and
only use the ones available with the package. Available in 0.9.10+.

Property Value
Aliases useOnlyPackageSilentArgs
Required? false
Position? named
Default Value False
Accept Pipeline Input? false

-IgnoredArguments [<Object[]>]

Allows splatting with arguments that do not apply. Do not use directly.

Property Value
Required? false
Position? named
Default Value
Accept Pipeline Input? false


This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters .

Function Reference

NOTE: This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Install-ChocolateyInstallPackage -Full.

View the source for Install-ChocolateyInstallPackage