summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnst Kuschke <ernstk@users.noreply.github.com>2015-05-20 16:34:21 +0200
committerErnst Kuschke <ernstk@users.noreply.github.com>2015-05-20 16:34:21 +0200
commit257d8ea2b12edf8f87af4d9b59dcf474a399e0c5 (patch)
treeca7eb1070533650740805828c766fd71e329da25
parentfefbf7c41a0b24097e9696aafcb57154eee6665b (diff)
downloadansible-modules-extras-257d8ea2b12edf8f87af4d9b59dcf474a399e0c5.tar.gz
Allow any custom chocolatey source
This is to allow for a local source (for instance in the form of artifactory)
-rw-r--r--windows/win_chocolatey.ps18
1 files changed, 6 insertions, 2 deletions
diff --git a/windows/win_chocolatey.ps1 b/windows/win_chocolatey.ps1
index 22e0d83e..de42434d 100644
--- a/windows/win_chocolatey.ps1
+++ b/windows/win_chocolatey.ps1
@@ -112,9 +112,9 @@ Else
If ($params.source)
{
$source = $params.source.ToString().ToLower()
- If (($source -ne "chocolatey") -and ($source -ne "webpi") -and ($source -ne "windowsfeatures") -and ($source -ne "ruby"))
+ If (($source -ne "chocolatey") -and ($source -ne "webpi") -and ($source -ne "windowsfeatures") -and ($source -ne "ruby") -and (!$source.startsWith("http://", "CurrentCultureIgnoreCase")) -and (!$source.startsWith("https://", "CurrentCultureIgnoreCase")))
{
- Fail-Json $result "source is $source - must be one of chocolatey, ruby, webpi or windowsfeatures."
+ Fail-Json $result "source is $source - must be one of chocolatey, ruby, webpi, windowsfeatures or a custom source url."
}
}
Elseif (!$params.source)
@@ -190,6 +190,10 @@ elseif (($source -eq "windowsfeatures") -or ($source -eq "webpi") -or ($source -
{
$expression += " -source $source"
}
+elseif(($source -ne $Null) -and ($source -ne ""))
+{
+ $expression += " -source $source"
+}
Set-Attr $result "chocolatey command" $expression
$op_result = invoke-expression $expression