Powershell and cmd environment variables

前端 未结 1 1199
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-24 23:48

I use a batch script to set some environment variables local to that shell. When I launch PowerShell from that command prompt, I was expecting those environment variables to be

相关标签:
1条回答
  • 2021-01-25 00:28

    Those environment variables should be there in PowerShell but you have to access them using the Environment provider e.g.:

    $env:foo
    

    where foo is the environment variable name.

    0 讨论(0)
提交回复
热议问题