From e54edf6952ea7ecccff3b70424c264bb9b2d6fd0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 7 Aug 2024 03:23:59 +0200 Subject: [PATCH] Add a function for checking NuGet packages --- scripts/Windows/Scripts/SoftwareManagement.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/Windows/Scripts/SoftwareManagement.ps1 b/scripts/Windows/Scripts/SoftwareManagement.ps1 index 864d9cfb..c850fa67 100644 --- a/scripts/Windows/Scripts/SoftwareManagement.ps1 +++ b/scripts/Windows/Scripts/SoftwareManagement.ps1 @@ -57,3 +57,18 @@ function Test-Command { [bool] (Get-Command $Name -ErrorAction SilentlyContinue); } + +<# + .SYNOPSIS + Checks whether a package with the specified name is installed. + + .PARAMETER Name + The name of the package to check. +#> +function Test-PSPackage { + param( + [string] $Name + ) + + [bool] (Get-Package $Name -ErrorAction SilentlyContinue); +}