diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-17 13:40:01 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-17 13:40:01 -0700 |
| commit | 7fac8a06c091c7d6a0a9dd059166d4320cd86267 (patch) | |
| tree | 29161e1f61cb33be27f734d59e88fc6567783878 | |
| parent | 147cde8bfda4e7283e4d47cd8a55c5bd0c689081 (diff) | |
| download | vcpkg-7fac8a06c091c7d6a0a9dd059166d4320cd86267.tar.gz vcpkg-7fac8a06c091c7d6a0a9dd059166d4320cd86267.zip | |
[fetchDependency] Add Test-Module function
| -rw-r--r-- | scripts/fetchDependency.ps1 | 15 |
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, |
