Skip to content

Commit 133319a

Browse files
authored
Update Install-ChocolateyPowershellCommand.ps1
1 parent 585e236 commit 133319a

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

WASP/Private/Install-ChocolateyPowershellCommand.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,20 @@ function Install-ChocolateyPowershellCommand() {
3232
$downloadFilePath = Join-Path (Join-Path (Get-Item -Path ".\").FullName "tools") "$($packageName)Install.ps1"
3333

3434
# Check the url found above ($url or $url64bit) and download the file. url64bit is preferred over url32 bit!
35-
if ($null -ne $url64bit) {
35+
$urlFound = ''
36+
37+
if ($url64bit -ne '' -and $null -ne $url64bit) {
3638
$urlFound = $url64bit
37-
} elseif ($null -ne $url) {
39+
} elseif ($url -ne '' -and $null -ne $url) {
3840
$urlFound = $url
39-
}
41+
}
42+
43+
if ($urlFound -eq ''){
44+
Write-Log "No url in Package found - Stop! url64bit: $url64bit, url: $url" -Severity 3
45+
exit 1
46+
}
47+
48+
Write-Log "Found the following URL: $urlFound" -Severity 1
4049

4150
Write-Log "Start editing chocolateyInstall..." -Severity 1
4251

0 commit comments

Comments
 (0)