Search notes:

Registry: HKEY_CURRENT_USER\Volatile Environment

Powershell

With Powershell and the COM object wscript.shell, it's possible to access the values of volatile environment variables like so
$wsh         = new-object -comObject wscript.shell
$volatileEnv = $wsh.environment("Volatile")

write-host   "USERNAME = " $volatileEnv.item("USERNAME")
Github repository about-Windows-Registry, path: /HKEY_CURRENT_USER/Volatile Environment/printVars.ps1

Index