@@ -53,11 +53,11 @@ Function Export-Artifact {
53
53
}
54
54
Process {
55
55
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 ) {
59
59
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')) {
61
61
If (!(Test-Path -LiteralPath $ItemResolve -PathType 'Leaf')) {
62
62
Continue
63
63
}
@@ -71,17 +71,19 @@ Function Export-Artifact {
71
71
$PathsValid += $ItemResolve
72
72
}
73
73
} Catch {
74
- $PathsInvalid += $ItemPath
74
+ $PathsInvalid += $ItemLiteralPath
75
75
}
76
76
}
77
77
#>
78
- $PathsProceed += $Path
78
+ $PathsProceed += ($LiteralPath | ForEach-Object - Process {
79
+ Return [WildcardPattern ]::Escape($_ )
80
+ })
79
81
}
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 ) {
83
85
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')) {
85
87
If (!(Test-Path -LiteralPath $ItemResolve -PathType 'Leaf')) {
86
88
Continue
87
89
}
@@ -95,13 +97,11 @@ Function Export-Artifact {
95
97
$PathsValid += $ItemResolve
96
98
}
97
99
} Catch {
98
- $PathsInvalid += $ItemLiteralPath
100
+ $PathsInvalid += $ItemPath
99
101
}
100
102
}
101
103
#>
102
- $PathsProceed += ($LiteralPath | ForEach-Object - Process {
103
- Return [WildcardPattern ]::Escape($_ )
104
- })
104
+ $PathsProceed += $Path
105
105
}
106
106
}
107
107
}
0 commit comments