Skip to content

Commit

Permalink
(#310) Ensure correct loading of profile
Browse files Browse the repository at this point in the history
During testing, it was found that the Chocolatey Profile was not being
correctly loaded, with neither  Update-SessionEnvironment nor
refreshenv working as expected.

This commit changes the profile loading to explicitly set the alas for
refreshenv, and also to load Update-SessionEnvironment as a Cmdlet,
rather than a Funcation.  This is needed since it is now written in C#
rather than PowerShell.
  • Loading branch information
gep13 committed May 27, 2024
1 parent f3c1215 commit 576527b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chocolatey.resources/helpers/chocolateyProfile.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Import-Module "$thisDirectory\Chocolatey.PowerShell.dll" -Cmdlet "Get-Environmen
. $thisDirectory\functions\Write-FunctionCallLogMessage.ps1
. $thisDirectory\ChocolateyTabExpansion.ps1

Export-ModuleMember -Alias refreshenv -Function 'Update-SessionEnvironment', 'TabExpansion'
Set-Alias refreshenv Update-SessionEnvironment

Export-ModuleMember -Alias refreshenv -Cmdlet 'Update-SessionEnvironment' -Function 'TabExpansion'

# SIG # Begin signature block
# MIInKwYJKoZIhvcNAQcCoIInHDCCJxgCAQExDzANBglghkgBZQMEAgEFADB5Bgor
Expand Down

0 comments on commit 576527b

Please sign in to comment.