@@ -346,11 +346,12 @@ function Get-GHActionsInput {
346
346
' all' {
347
347
$ResultIsHashtable = $true
348
348
Get-ChildItem - Path ' Env:\' - Include ' INPUT_*' - Name | ForEach-Object - Process {
349
- $InputValue = Get-ChildItem - Path " Env:\$_ "
349
+ [string ]$InputKey = $_ -replace ' ^INPUT_' , ' '
350
+ [string ]$InputValue = Get-ChildItem - Path " Env:\INPUT_$InputKey "
350
351
if ($Trim ) {
351
- $Result [$_ ] = $InputValue.Value.Trim ()
352
+ $Result [$InputKey ] = $InputValue.Value.Trim ()
352
353
} else {
353
- $Result [$_ ] = $InputValue.Value
354
+ $Result [$InputKey ] = $InputValue.Value
354
355
}
355
356
}
356
357
break
@@ -360,11 +361,12 @@ function Get-GHActionsInput {
360
361
if ([WildcardPattern ]::ContainsWildcardCharacters($_ )) {
361
362
$ResultIsHashtable = $true
362
363
Get-ChildItem - Path ' Env:\' - Include " INPUT_$_ " - Name | ForEach-Object - Process {
363
- $InputValue = Get-ChildItem - Path " Env:$_ "
364
+ [string ]$InputKey = $_ -replace ' ^INPUT_' , ' '
365
+ [string ]$InputValue = Get-ChildItem - Path " Env:\INPUT_$InputKey "
364
366
if ($Trim ) {
365
- $Result [$_ ] = $InputValue.Value.Trim ()
367
+ $Result [$InputKey ] = $InputValue.Value.Trim ()
366
368
} else {
367
- $Result [$_ ] = $InputValue.Value
369
+ $Result [$InputKey ] = $InputValue.Value
368
370
}
369
371
}
370
372
} else {
@@ -440,11 +442,12 @@ function Get-GHActionsState {
440
442
' all' {
441
443
$ResultIsHashtable = $true
442
444
Get-ChildItem - Path ' Env:\' - Include ' STATE_*' - Name | ForEach-Object - Process {
443
- $StateValue = Get-ChildItem - Path " Env:\$_ "
445
+ [string ]$StateKey = $_ -replace ' ^STATE_' , ' '
446
+ [string ]$StateValue = Get-ChildItem - Path " Env:\STATE_$StateKey "
444
447
if ($Trim ) {
445
- $Result [$_ ] = $StateValue.Value.Trim ()
448
+ $Result [$StateKey ] = $StateValue.Value.Trim ()
446
449
} else {
447
- $Result [$_ ] = $StateValue.Value
450
+ $Result [$StateKey ] = $StateValue.Value
448
451
}
449
452
}
450
453
break
@@ -454,11 +457,12 @@ function Get-GHActionsState {
454
457
if ([WildcardPattern ]::ContainsWildcardCharacters($_ )) {
455
458
$ResultIsHashtable = $true
456
459
Get-ChildItem - Path ' Env:\' - Include " STATE_$_ " - Name | ForEach-Object - Process {
457
- $StateValue = Get-ChildItem - Path " Env:$_ "
460
+ [string ]$StateKey = $_ -replace ' ^STATE_' , ' '
461
+ [string ]$StateValue = Get-ChildItem - Path " Env:\STATE_$StateKey "
458
462
if ($Trim ) {
459
- $Result [$_ ] = $StateValue.Value.Trim ()
463
+ $Result [$StateKey ] = $StateValue.Value.Trim ()
460
464
} else {
461
- $Result [$_ ] = $StateValue.Value
465
+ $Result [$StateKey ] = $StateValue.Value
462
466
}
463
467
}
464
468
} else {
0 commit comments