

So this is the new approach you might want to put it in a script or something. I tried compensated by handling PATH seperately, but sometimes there are other such variables. The old approach I originally answered with has a few quirks with environment variables that use a delimiter. However, ferventcoder points out that this updating of $PROFILE doesn't always happen, so it cannot be relied upon. to load the Chocolatey profile, relying on Chocolatey to have updated $PROFILE already at that point. # This should make git.exe accessible via the refreshed $env:PATH, so that it # (rather than invoking refreshenv.cmd, the *batch file* for use with cmd.exe) # refreshenv is now an alias for Update-SessionEnvironment Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\.\." $PROFILE` instead *may* work, but isn't guaranteed to. # variable and importing the Chocolatey profile module. # Make `refreshenv` available right away, by defining the $env:ChocolateyInstall That said, you should be able to emulate what Chocolatey does when $PROFILE is sourced in future sessions in order to be able to use refreshenv / Update-SessionEnvironment right away, immediately after installing Chocolatey: iex ((New-Object ).DownloadString('')) However, immediately after installing Chocolatey itself, refreshenv / Update-SessionEnvironment themselves are only available in future PowerShell sessions, because loading these commands happens via code added to profile $PROFILE, based on environment variable $env:ChocolateyInstall. Refreshenv (an alias for Update-SessionEnvironment) is generally the right command to use to update the current session with environment-variable changes after a choco install.
