aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-10-17 13:40:01 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-10-17 13:40:01 -0700
commit7fac8a06c091c7d6a0a9dd059166d4320cd86267 (patch)
tree29161e1f61cb33be27f734d59e88fc6567783878 /scripts
parent147cde8bfda4e7283e4d47cd8a55c5bd0c689081 (diff)
downloadvcpkg-7fac8a06c091c7d6a0a9dd059166d4320cd86267.tar.gz
vcpkg-7fac8a06c091c7d6a0a9dd059166d4320cd86267.zip
[fetchDependency] Add Test-Module function
Diffstat (limited to 'scripts')
-rw-r--r--scripts/fetchDependency.ps115
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1
index 6024895ae..2ba98ab23 100644
--- a/scripts/fetchDependency.ps1
+++ b/scripts/fetchDependency.ps1
@@ -3,6 +3,16 @@ param(
[string]$Dependency
)
+function Test-Command($commandName)
+{
+ return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue)
+}
+
+function Test-Module($moduleName)
+{
+ return [bool](Get-Module -ListAvailable -Name $moduleName)
+}
+
if ($PSVersionTable.PSEdition -ne "Core") {
Import-Module BitsTransfer -Verbose:$false
}
@@ -14,11 +24,6 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root
$downloadsDir = "$vcpkgRootDir\downloads"
-function Test-Command($commandName)
-{
- return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue)
-}
-
function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
{
function performDownload( [Parameter(Mandatory=$true)][string]$Dependency,