def --env refreshenv [] { let user_path = registry query --hkcu environment | where name == Path | get value | split row ';' | where { |x| $x != '' } let sys_path = registry query --hklm 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment' | where name == Path | get value | split row ';' | where { |x| $x != '' } let out = $user_path ++ $sys_path ++ $env.path | uniq --ignore-case $env.path = $out }