Hello, I am to powershell and not sure how what command to use to list or display all environment variables using powershell? Thanks.
You can simply use below powershell command to list environment variables, with name/value
gci env:* | sort-object name
Output of the above powershell command will be as below
OR
You can simply use below command
Get-ChildItem Env:
OR
If you need filtered output, you can use below command
gci env: | where name -like 'Java*'
Thanks.
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly