Skip to content

Commit 5e96478

Browse files
committed
20220629A
1 parent e6bd6cc commit 5e96478

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hugoalh.GitHubActionsToolkit/module/tool-cache.psm1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,12 @@ Function Invoke-ToolCacheToolDownloader {
149149
[OutputType([String[]])]
150150
Param (
151151
[Parameter(Mandatory = $True, Position = 0, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)][ValidateScript({
152-
$URIObject = $_ -as [System.URI]
153-
Return (($Null -ine $URIObject.AbsoluteURI) -and ($_ -imatch '^https?:\/\/'))
152+
Try {
153+
$UriObject = $_ -as [System.Uri]
154+
} Catch {
155+
Return $False
156+
}
157+
Return (($Null -ine $UriObject.AbsoluteUri) -and ($_.Scheme -imatch '^https?$'))
154158
}, ErrorMessage = '`{0}` is not a valid URI!')][Alias('Url')][String[]]$Uri,
155159
[Alias('Target')][String]$Destination,
156160
[Alias('Auth')][String]$Authorization,

0 commit comments

Comments
 (0)