Skip to content

Commit 9d64455

Browse files
mwallnergep13
authored andcommitted
chocolateyGH-405: fix missing named params
1 parent 70c28c3 commit 9d64455

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

.metals/metals.h2.db

5.12 MB
Binary file not shown.

.metals/metals.lock.db

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#FileLock
2+
#Thu Jul 30 20:35:33 CEST 2020
3+
hostName=localhost
4+
id=173a1020ffa16237c13c7aa2432c0c73f2a8b08f7c4
5+
method=file
6+
server=localhost\:63706

Boxstarter.Chocolatey/Chocolatey.ps1

+23-12
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,24 @@ function Get-PackageNamesFromInvocationLine {
328328
# we somehow need to know what parameters are named and can take a value
329329
# - if we don't know, the parameter's value will be treated as package name
330330
$namedParameters = @("force:", # -force:$bool is a zebra
331-
"s", "source",
332-
"ia", "installargs", "installarguments",
333-
"params", "parameters", "pkgparameters", "packageparameters",
334-
"cp",
331+
"s", "source",
332+
"log-file",
333+
"version",
334+
"ia", "installargs", "installarguments", "install-arguments",
335+
"override", "overrideargs", "overridearguments", "override-arguments",
336+
"params", "parameters", "pkgparameters", "packageparameters", "package-parameters",
337+
"user", "password", "cert", "cp", "certpassword",
335338
"checksum", "downloadchecksum", "checksum64", "checksumx64", "downloadchecksumx64",
336-
"checksumtype", "checksum-type", "downloadchecksumtyp",
337-
"checksumtype64", "checksumtypex64", "checksum-type-x64", "downloadchecksumtypex64")
339+
"checksumtype", "checksum-type", "downloadchecksumtype",
340+
"checksumtype64", "checksumtypex64", "checksum-type-x64", "downloadchecksumtypex64",
341+
"timeout", "execution-timeout",
342+
"cache", "cachelocation", "cache-location",
343+
"proxy", "proxy-user", "proxy-password", "proxy-bypass-list",
344+
"viruspositivesmin", "virus-positives-minimum",
345+
"install-arguments-sensitive", "package-parameters-sensitive",
346+
"dir", "directory", "installdir", "installdirectory", "install-dir", "install-directory",
347+
"bps", "maxdownloadrate", "max-download-rate", "maxdownloadbitspersecond", "max-download-bits-per-second",
348+
"maximumdownloadbitspersecond", "maximum-download-bits-per-second")
338349

339350
$skipNext = $false
340351
foreach ($a in $InvocationArguments) {
@@ -379,18 +390,18 @@ function Get-PassedArg {
379390
$nextIsValue = $false
380391
$val = $null
381392

382-
$OriginalArgs | Foreach-Object {
393+
foreach ($a in $OriginalArgs) {
383394
if ($nextIsValue) {
384395
$nextIsValue = $false
385-
$val = $_
386-
return
396+
$val = $a
397+
break;
387398
}
388399

389-
if ($candidateKeys -contains $_) {
400+
if ($candidateKeys -contains $a) {
390401
$nextIsValue = $true
391402
}
392-
elseif ($_.ToString().Contains("=")) {
393-
$parts = $_.split("=", 2)
403+
elseif ($a.ToString().Contains("=")) {
404+
$parts = $a.split("=", 2)
394405
$nextIsValue = $false
395406
$val = $parts[1]
396407
}

0 commit comments

Comments
 (0)