nano Quick Tip: Append to Path environment Variable

Making a persistent change to the PATH environment variable in Windows Nano was harder than expected.  I found many forum/blog posts that had different PowerShell scripts to append to PATH that would work in older versions of windows but not in Nano.  I finally found the following script works in Nano: 

Set-ItemProperty -Path ‘HKLM:\System\CurrentControlSet\Control\Session Manager\Environment’ -Name PATH -Value $($env:Path + ";C:\chef\bin")

Now I can access the Chef executables from any path.  You will need to open a new PowerShell session to use the new path because the environment variables are loaded at the beginning of the session.

Leave a Reply