19 lines
499 B
PowerShell
19 lines
499 B
PowerShell
function Test-IsChocoPackageInstalled {
|
|
<#
|
|
.SYNOPSIS
|
|
This function checks to see if a chocolatey package with a given id has been installed.
|
|
|
|
.PARAMETER PackageName
|
|
[string] The name/id of a chocolatey package
|
|
#>
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$PackageName
|
|
)
|
|
|
|
$chocoInstallPath = (Get-ChocolateyInstallPath)
|
|
$packagePath = (Join-Path (Join-Path $chocoInstallPath "lib") $PackageName)
|
|
|
|
return (Test-Path $packagePath)
|
|
} |