Install-BinFile

Creates a shim (or batch redirect) for a file that is on the PATH.

Syntax

Install-BinFile `
  -Name <String> `
  -Path <String> `
  [-UseStart] `
  [-Command <String>] `
  [-IgnoredArguments <Object[]>] [<CommonParameters>]

Description

Chocolatey installs have the folder $($env:ChocolateyInstall)\bin included in the PATH environment variable. Chocolatey automatically shims executables in package folders that are not explicitly ignored, putting them into the bin folder (and subsequently onto the PATH).

When you have other files you want to shim to add them to the PATH or if you want to handle the shimming explicitly, use this function.

If you do use this function, ensure you also add Uninstall-BinFile to your chocolateyUninstall.ps1 script as Chocolatey will not automatically clean up shims created with this function.

Notes

Not normally needed for exe files in the package folder, those are automatically discovered and added as shims after the install script completes.

Aliases

Add-BinFile Generate-BinFile

Inputs

None

Outputs

None

Parameters

-Name <String>

PropertyValue
Aliases
Required?true
Position?1
Default Value
Accept Pipeline Input?false

-Path <String>

PropertyValue
Aliases
Required?true
Position?2
Default Value
Accept Pipeline Input?false

-UseStart

PropertyValue
AliasesisGui
Required?false
Position?named
Default ValueFalse
Accept Pipeline Input?false

-Command [<String>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

-IgnoredArguments [<Object[]>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters http://go.microsoft.com/fwlink/p/?LinkID=113216 .

Function Reference

:choco-info: NOTE

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

View the source for Install-BinFile