From d75877aa2f477477fe9f8329d11238759cce8e6b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 7 Aug 2024 23:18:23 +0200 Subject: [PATCH] Show messages if packages are installed --- scripts/Common/Scripts/Software.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/Common/Scripts/Software.ps1 b/scripts/Common/Scripts/Software.ps1 index ea4b91b1e..e184d9f6e 100644 --- a/scripts/Common/Scripts/Software.ps1 +++ b/scripts/Common/Scripts/Software.ps1 @@ -32,7 +32,10 @@ $null = New-Module { if (-not ($Force.IsPresent)) { for ($i = $Names.Count - 1; $i -ge 0; $i--) { - if (Test-ChocoPackage $Names[$i]) { + $name = $Names[$i]; + + if (Test-ChocoPackage $name) { + Write-Host "Package ``$name`` is already installed" $Names.RemoveAt($i); } } @@ -64,6 +67,8 @@ $null = New-Module { --source winget ` --scope machine ` --exact --id $name; + } else { + Write-Host "Package ``$name`` is already installed" } } }