From 90675f3e148f2ce7ebf3fbbd957e6b1f8d0224b5 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 31 Jul 2024 14:53:21 +0200 Subject: [PATCH] Add a script for checking for installed choco packages --- scripts/Windows/Scripts/Choco.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 scripts/Windows/Scripts/Choco.ps1 diff --git a/scripts/Windows/Scripts/Choco.ps1 b/scripts/Windows/Scripts/Choco.ps1 new file mode 100644 index 00000000..99b89e5e --- /dev/null +++ b/scripts/Windows/Scripts/Choco.ps1 @@ -0,0 +1,15 @@ +<# + .SYNOPSIS + Checks whether the specified package has been installed using Chocolatey. + + .PARAMETER Name + The name of the package to check. +#> +function Test-ChocoSoftware { + [OutputType([bool])] + param( + [string] $Name + ); + + -not [string]::IsNullOrEmpty((choco list --limit-output --exact $name)); +}