File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,32 @@ process {
106106 Arch = $env: RUNNER_ARCH
107107 Environment = $env: RUNNER_ENVIRONMENT
108108 Temp = $env: RUNNER_TEMP
109- Perflog = $env: RUNNER_PERFLOG
110- ToolCache = $env: RUNNER_TOOL_CACHE
111- TrackingID = $env: RUNNER_TRACKING_ID
109+ Perflog = $env: RUNNER_PERFLOG
110+ ToolCache = $env: RUNNER_TOOL_CACHE
111+ TrackingID = $env: RUNNER_TRACKING_ID
112112 Workspace = $env: RUNNER_WORKSPACE
113113 Processors = [System.Environment ]::ProcessorCount
114114 } | Format-List
115+
116+ # Create an empty hashtable to store property name/value pairs.
117+ $props = @ {}
118+
119+ # Enumerate each static property on [System.Environment].
120+ [System.Environment ] |
121+ Get-Member - Static - MemberType Property |
122+ ForEach-Object {
123+ # Store the value of each static property in the hashtable,
124+ # keyed by the property name.
125+ $props [$_.Name ] = [System.Environment ]::$ ($_.Name )
126+ }
127+
128+ # Cast the hashtable to a PSCustomObject so you get a single object
129+ # with all property/value pairs.
130+ $EnvironmentObject = [PSCustomObject ]$props
131+
132+ # Display the custom object.
133+ $EnvironmentObject | Format-List
134+
115135 }
116136
117137 Write-Output ' ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛'
You can’t perform that action at this time.
0 commit comments