ps/Modules/Alkami.PowerShell.Choco/Public/Test-IsChocoPackageInstalled.ps1
2023-05-30 22:51:22 -07:00

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)
}