Skip to content

Commit d24c9bc

Browse files
committed
20220627A
1 parent a763554 commit d24c9bc

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

hugoalh.GitHubActionsToolkit/module/artifact.psm1

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ Function Export-Artifact {
5353
}
5454
Process {
5555
Switch ($PSCmdlet.ParameterSetName) {
56-
'Path' {
57-
<# Disable, not a good method.
58-
ForEach ($ItemPath In $Path) {
56+
'LiteralPath' {
57+
<# Disable, not a good method
58+
ForEach ($ItemLiteralPath In $LiteralPath) {
5959
Try {
60-
ForEach ($ItemResolve In [String[]](Resolve-Path -Path ([System.IO.Path]::IsPathRooted($ItemPath) ? $ItemPath : (Join-Path -Path $BaseRoot -ChildPath $ItemPath)) -ErrorAction 'SilentlyContinue')) {
60+
ForEach ($ItemResolve In [String[]](Resolve-Path -LiteralPath ([System.IO.Path]::IsPathRooted($ItemLiteralPath) ? $ItemLiteralPath : (Join-Path -Path $BaseRoot -ChildPath $ItemLiteralPath)) -ErrorAction 'SilentlyContinue')) {
6161
If (!(Test-Path -LiteralPath $ItemResolve -PathType 'Leaf')) {
6262
Continue
6363
}
@@ -71,17 +71,19 @@ Function Export-Artifact {
7171
$PathsValid += $ItemResolve
7272
}
7373
} Catch {
74-
$PathsInvalid += $ItemPath
74+
$PathsInvalid += $ItemLiteralPath
7575
}
7676
}
7777
#>
78-
$PathsProceed += $Path
78+
$PathsProceed += ($LiteralPath | ForEach-Object -Process {
79+
Return [WildcardPattern]::Escape($_)
80+
})
7981
}
80-
'LiteralPath' {
81-
<# Disable, not a good method
82-
ForEach ($ItemLiteralPath In $LiteralPath) {
82+
'Path' {
83+
<# Disable, not a good method.
84+
ForEach ($ItemPath In $Path) {
8385
Try {
84-
ForEach ($ItemResolve In [String[]](Resolve-Path -LiteralPath ([System.IO.Path]::IsPathRooted($ItemLiteralPath) ? $ItemLiteralPath : (Join-Path -Path $BaseRoot -ChildPath $ItemLiteralPath)) -ErrorAction 'SilentlyContinue')) {
86+
ForEach ($ItemResolve In [String[]](Resolve-Path -Path ([System.IO.Path]::IsPathRooted($ItemPath) ? $ItemPath : (Join-Path -Path $BaseRoot -ChildPath $ItemPath)) -ErrorAction 'SilentlyContinue')) {
8587
If (!(Test-Path -LiteralPath $ItemResolve -PathType 'Leaf')) {
8688
Continue
8789
}
@@ -95,13 +97,11 @@ Function Export-Artifact {
9597
$PathsValid += $ItemResolve
9698
}
9799
} Catch {
98-
$PathsInvalid += $ItemLiteralPath
100+
$PathsInvalid += $ItemPath
99101
}
100102
}
101103
#>
102-
$PathsProceed += ($LiteralPath | ForEach-Object -Process {
103-
Return [WildcardPattern]::Escape($_)
104-
})
104+
$PathsProceed += $Path
105105
}
106106
}
107107
}

0 commit comments

Comments
 (0)