Last active
September 28, 2015 17:19
-
-
Save tillig/ebe7ca1af84aa5f28c38 to your computer and use it in GitHub Desktop.
Boxstarter Package Detection Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Detects whether a specific package is already installed | |
function Test-PackageInstalled | |
{ | |
param([Parameter(Mandatory=$true)][string] $packageName) | |
$found = Get-ChildItem -Path "$env:ChocolateyInstall\lib" -Directory -Filter "$packageName.*" | Measure-Object | Select-Object -ExpandProperty Count | |
return $found -ne 0 | |
} | |
Test-PackageInstalled nuget.commandline | |
Test-PackageInstalled notinstalled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment