@@ -31,8 +31,8 @@ Function Expand-ToolCacheCompressedFile {
31
31
[Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Source' )][String ]$File ,
32
32
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Target' )][String ]$Destination ,
33
33
[Parameter (ValueFromPipelineByPropertyName = $True )][ValidateSet (' 7z' , ' Auto' , ' Automatic' , ' Automatically' , ' Tar' , ' Xar' , ' Zip' )][String ]$Method = ' Automatically' ,
34
- [String ]$7zrPath = ' ' ,
35
- [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Flags' )][String ]$Flag = ' '
34
+ [String ]$7zrPath ,
35
+ [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Flags' )][String ]$Flag
36
36
)
37
37
Begin {
38
38
[Boolean ]$NoOperation = $False # When the requirements are not fulfill, only stop this function but not others.
@@ -117,7 +117,7 @@ Function Find-ToolCache {
117
117
Param (
118
118
[Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' ToolName' )][String ]$Name ,
119
119
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Ver' )][String ]$Version = ' *' ,
120
- [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Arch' )][String ]$Architecture = ' '
120
+ [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Arch' )][String ]$Architecture
121
121
)
122
122
Begin {
123
123
[Boolean ]$NoOperation = $False # When the requirements are not fulfill, only stop this function but not others.
@@ -170,10 +170,10 @@ Function Invoke-ToolCacheToolDownloader {
170
170
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_invoke-githubactionstoolcachetooldownloader#Invoke-GitHubActionsToolCacheToolDownloader' )]
171
171
[OutputType ([String ])]
172
172
Param (
173
- [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][ValidateScript ({ Return (($Null -ine $_.AbsoluteUri ) -and ($_.Scheme -imatch ' ^https?$' )) }, ErrorMessage = ' `{0}` is not a valid URI!' )][Alias (' Url' )][Uri ]$Uri ,
174
- [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Target' )][String ]$Destination = ' ' ,
175
- [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Auth' )][String ]$Authorization = ' ' ,
176
- [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Headers' )][Hashtable ]$Header = @ {}
173
+ [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][ValidateScript ({ Return (($Null -ine $_.AbsoluteUri ) -and ($_.Scheme -imatch ' ^https?$' )) }, ErrorMessage = ' `{0}` is not a valid URI!' )][Alias (' Source ' , ' Url' )][Uri ]$Uri ,
174
+ [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Target' )][String ]$Destination ,
175
+ [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Auth' )][String ]$Authorization ,
176
+ [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Headers' )][Hashtable ]$Header
177
177
)
178
178
Begin {
179
179
[Boolean ]$NoOperation = $False # When the requirements are not fulfill, only stop this function but not others.
@@ -187,7 +187,7 @@ Function Invoke-ToolCacheToolDownloader {
187
187
Return
188
188
}
189
189
[Hashtable ]$InputObject = @ {
190
- Uri = $Uri
190
+ Uri = $Uri.ToString ()
191
191
}
192
192
If ($Destination.Length -igt 0 ) {
193
193
$InputObject.Destination = $Destination
@@ -196,7 +196,7 @@ Function Invoke-ToolCacheToolDownloader {
196
196
$InputObject.Authorization = $Authorization
197
197
}
198
198
If ($Header.Count -igt 0 ) {
199
- $InputObject.Header = ( [PSCustomObject ]$Header | ConvertTo-Json - Depth 100 - Compress)
199
+ $InputObject.Header = [PSCustomObject ]$Header
200
200
}
201
201
$ResultRaw = Invoke-GitHubActionsNodeJsWrapper - Path ' tool-cache\download-tool.js' - InputObject ([PSCustomObject ]$InputObject | ConvertTo-Json - Depth 100 - Compress)
202
202
If ($Null -ieq $ResultRaw ) {
@@ -229,7 +229,7 @@ Function Register-ToolCacheDirectory {
229
229
[Parameter (Mandatory = $True , Position = 0 , ValueFromPipelineByPropertyName = $True )][Alias (' SourceDirectory' )][String ]$Source ,
230
230
[Parameter (Mandatory = $True , Position = 1 , ValueFromPipelineByPropertyName = $True )][Alias (' ToolName' )][String ]$Name ,
231
231
[Parameter (Mandatory = $True , Position = 2 , ValueFromPipelineByPropertyName = $True )][Alias (' Ver' )][String ]$Version ,
232
- [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Arch' )][String ]$Architecture = ' '
232
+ [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Arch' )][String ]$Architecture
233
233
)
234
234
Begin {
235
235
[Boolean ]$NoOperation = $False # When the requirements are not fulfill, only stop this function but not others.
@@ -250,7 +250,7 @@ Function Register-ToolCacheDirectory {
250
250
If ($Architecture.Length -igt 0 ) {
251
251
$InputObject.Architecture = $Architecture
252
252
}
253
- $ResultRaw = Invoke-GitHubActionsNodeJsWrapper - Path " tool-cache\cache-directory.js" - InputObject ([PSCustomObject ]$InputObject | ConvertTo-Json - Depth 100 - Compress)
253
+ $ResultRaw = Invoke-GitHubActionsNodeJsWrapper - Path ' tool-cache\cache-directory.js' - InputObject ([PSCustomObject ]$InputObject | ConvertTo-Json - Depth 100 - Compress)
254
254
If ($Null -ieq $ResultRaw ) {
255
255
Return
256
256
}
@@ -284,7 +284,7 @@ Function Register-ToolCacheFile {
284
284
[Parameter (Mandatory = $True , Position = 1 , ValueFromPipelineByPropertyName = $True )][Alias (' TargetFile' )][String ]$Target ,
285
285
[Parameter (Mandatory = $True , Position = 2 , ValueFromPipelineByPropertyName = $True )][Alias (' ToolName' )][String ]$Name ,
286
286
[Parameter (Mandatory = $True , Position = 3 , ValueFromPipelineByPropertyName = $True )][Alias (' Ver' )][String ]$Version ,
287
- [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Arch' )][String ]$Architecture = ' '
287
+ [Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Arch' )][String ]$Architecture
288
288
)
289
289
Begin {
290
290
[Boolean ]$NoOperation = $False # When the requirements are not fulfill, only stop this function but not others.
@@ -306,7 +306,7 @@ Function Register-ToolCacheFile {
306
306
If ($Architecture.Length -igt 0 ) {
307
307
$InputObject.Architecture = $Architecture
308
308
}
309
- $ResultRaw = Invoke-GitHubActionsNodeJsWrapper - Path " tool-cache\cache-file.js" - InputObject ([PSCustomObject ]$InputObject | ConvertTo-Json - Depth 100 - Compress)
309
+ $ResultRaw = Invoke-GitHubActionsNodeJsWrapper - Path ' tool-cache\cache-file.js' - InputObject ([PSCustomObject ]$InputObject | ConvertTo-Json - Depth 100 - Compress)
310
310
If ($Null -ieq $ResultRaw ) {
311
311
Return
312
312
}
0 commit comments