File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
hugoalh.GitHubActionsToolkit/module Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -121,20 +121,19 @@ Function Set-EnvironmentVariable {
121
121
}
122
122
End {
123
123
If ($Result.Count -igt 0 ) {
124
- [PSCustomObject []]$ResultEnumerator = $Result.GetEnumerator ()
125
124
Switch - Exact ($Scope.ToString () - isplit ' , ' ) {
126
125
' Current' {
127
- $ResultEnumerator | ForEach-Object - Process {
126
+ $Result .GetEnumerator () | ForEach-Object - Process {
128
127
[System.Environment ]::SetEnvironmentVariable($_.Name , $_.Value ) | Out-Null
129
128
}
130
129
}
131
130
' Subsequent' {
132
131
If ($Null -ieq $Env: GITHUB_ENV ) {
133
- $ResultEnumerator | ForEach-Object - Process {
134
- Write-GitHubActionsCommand - Command ' set-env' - Parameter @ { ' name' = $Item .Name } - Value $Item .Value
132
+ $Result .GetEnumerator () | ForEach-Object - Process {
133
+ Write-GitHubActionsCommand - Command ' set-env' - Parameter @ { ' name' = $_ .Name } - Value $_ .Value
135
134
}
136
135
} Else {
137
- Add-Content - LiteralPath $Env: GITHUB_ENV - Value (($ResultEnumerator | ForEach-Object - Process {
136
+ Add-Content - LiteralPath $Env: GITHUB_ENV - Value (($Result .GetEnumerator () | ForEach-Object - Process {
138
137
Return " $ ( $_.Name ) =$ ( $_.Value ) "
139
138
}) -join " `n " ) - Confirm:$False - Encoding ' UTF8NoBOM'
140
139
}
You can’t perform that action at this time.
0 commit comments