Show messages if packages are installed

This commit is contained in:
Manuel Thalmann 2024-08-07 23:18:23 +02:00
parent 64fe00e42f
commit e9be3db64e

View file

@ -32,7 +32,10 @@ $null = New-Module {
if (-not ($Force.IsPresent)) { if (-not ($Force.IsPresent)) {
for ($i = $Names.Count - 1; $i -ge 0; $i--) { 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); $Names.RemoveAt($i);
} }
} }
@ -64,6 +67,8 @@ $null = New-Module {
--source winget ` --source winget `
--scope machine ` --scope machine `
--exact --id $name; --exact --id $name;
} else {
Write-Host "Package ``$name`` is already installed"
} }
} }
} }