Display all environment variables from a running PowerShell script
Shortest version (with variables sorted by name):
gci env:
I finally fumbled my way into a solution by iterating over each entry in the dictionary:
(gci env:*).GetEnumerator() | Sort-Object Name | Out-String
Shorter version:
gci env:* | sort-object name
This will display both the name and value.