NOTE: Administrative Access Required.
Creates an association between a file extension and a executable.
Install-ChocolateyFileAssociation `
-Extension <String> `
-Executable <String> `
[-IgnoredArguments <Object[]>] [<CommonParameters>]
Install-ChocolateyFileAssociation can associate a file extension with a downloaded application. Once this command has created an association, all invocations of files with the specified extension will be opened via the executable specified.
This command will assert UAC/Admin privileges on the machine.
None
EXAMPLE 1
# This will create an association between Sublime Text 2 and all .txt
# files. Any .txt file opened will by default open with Sublime Text 2.
$sublimeDir = (Get-ChildItem $env:ALLUSERSPROFILE\chocolatey\lib\sublimetext* | select $_.last)
$sublimeExe = "$sublimeDir\tools\sublime_text.exe"
Install-ChocolateyFileAssociation ".txt" $sublimeExe
None
None
The file extension to be associated.
Property | Value |
---|---|
Aliases | |
Required? | true |
Position? | 1 |
Default Value | |
Accept Pipeline Input? | false |
The path to the application's executable to be associated.
Property | Value |
---|---|
Aliases | |
Required? | true |
Position? | 2 |
Default Value | |
Accept Pipeline Input? | false |
Allows splatting with arguments that do not apply. Do not use directly.
Property | Value |
---|---|
Aliases | |
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
http://go.microsoft.com/fwlink/p/?LinkID=113216 .
[[Function Reference|HelpersReference]]
NOTE: This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Install-ChocolateyFileAssociation -Full
.
View the source for Install-ChocolateyFileAssociation