Skip to content

Commit f0b7f8c

Browse files
committed
feat(Microsoft.PowerShell_profile.ps1): add Chocolatey tab-completion support
This commit introduces the necessary code to enable tab-completions for Chocolatey package manager commands in the PowerShell profile, enhancing the user experience by providing command auto-completion features.
1 parent c24f825 commit f0b7f8c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Microsoft.PowerShell_profile.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,14 @@ foreach ($FilePath in Get-ChildItem -Path "$PSScriptRoot\Core\Configs" -File) {
2121
# Auto-load extensions:
2222
foreach ($FilePath in Get-ChildItem -Path "$PSScriptRoot\Core\Extensions" -File) {
2323
. $FilePath
24-
}
24+
}
25+
26+
# Import the Chocolatey Profile that contains the necessary code to enable
27+
# tab-completions to function for `choco`.
28+
# Be aware that if you are missing these lines from your profile, tab completion
29+
# for `choco` will not function.
30+
# See https://ch0.co/tab-completion for details.
31+
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
32+
if (Test-Path($ChocolateyProfile)) {
33+
Import-Module "$ChocolateyProfile"
34+
}

0 commit comments

Comments
 (0)