How to fix Enviornment path variable because it need restart?

What i actually want is to set ENV path variables without restarting node. because it will terminate my recipies . Is their any option to silently apply path ?

Hi @Ankur760,

Check the windows_path LWRP in the windows cookbook

Set environment variable using this command -

[Environment]::SetEnvironmentVariable(“JobName”, “DeployProvEnv.”, “Machine”)

This would let you add environment variable without restart and make it accessible. If you still don’t find the variable, then add this command in powershell_script resource to reload the machine level environment variable.

$env:Path = [System.Environment]::GetEnvironmentVariable(“Path”,“Machine”)

Thanks,
Lokesh Jangir