'Issue with Environment Variables on VM

I am having a weird issue with Environment Variables on a VM or may be there's something that I don't know about them.

I am setting few environment variables through the Azure DevOps release pipeline using the following command.

setx NameOfEnvVar ValueOfEnvVar /m

Post completion of the release pipeline the environment variable is visible through the System Properties -> Environment Variable Window.

However, when I am running the 'set' command from the command line(as Administrator) on the VM the 'NameOfEnvVar' is not showing up.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source