Display all environment variables from a running PowerShell script

前端 未结 5 1001
猫巷女王i
猫巷女王i 2020-12-12 18:37

I need to display all configured environment variables in a PowerShell script at runtime. Normally when displaying environment variables I can just use one of the following

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 19:14

    Shorter version:

    gci env:* | sort-object name
    

    This will display both the name and value.

提交回复
热议问题