refreshenv
#chocolatey #PowerShell #cmd
chocolateyに付属のヘルパースクリプト
環境変数をリフレッシュしてくれる
https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd
PowerShellの場合
See: https://stackoverflow.com/questions/46758437/how-to-refresh-the-environment-of-a-powershell-session-after-a-chocolatey-instal)
code:powershell
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
refreshenvがないけどとりあえずPATHをアップデートしたい場合
PowerShellなら
code:powershell
$Env:Path = System.Environment::GetEnvironmentVariable("Path","Machine") + ";" + System.Environment::GetEnvironmentVariable("Path","User")