FMeinicke's Wiki

Home

❯

Windows

❯

Powershell

❯

Print environment variable of process

Print environment variable of process

May 27, 20251 min read

  • pwsh/get-process
  • python/psutil/Process
  • environment-variables

get-process Process environment-variables

Source

  • https://superuser.com/a/1756391/1201131
  • https://ollama.lancetoni.local/c/3e9b5440-b2f6-4477-a7d3-a3dbbd39ad8b
$proc_id = (Get-Process -Name "<NAME>").Id; python -c "import psutil; print(psutil.Process(pid=$proc_id).environ()['PATH'])"

replace <NAME> with the process name and optionally PATH with another environment variable name


Graph View

Created with Quartz v4.5.0 © 2025

  • GitHub