Remove Windows setx environment variables PowerShell | Michael Hirsch, Ph.D.
In Windows, the setx command allows storing environment variables in the Windows registry on a per-user or system basis. A problem arises when it is desired to remove such variables entirely. Unlike older versions of Windows, setting a blank value does not work in Windows 10.
is only effective for this PowerShell session. The old value of CC comes back upon opening a new PowerShell.