From 7fac8a06c091c7d6a0a9dd059166d4320cd86267 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 13:40:01 -0700 Subject: [fetchDependency] Add Test-Module function --- scripts/fetchDependency.ps1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'scripts') 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, -- cgit v1.2.3