From d88e6c40d8ce6036ef849819bdb43d4fc89d1d73 Mon Sep 17 00:00:00 2001 From: Aaron <54756786+AaronVickers@users.noreply.github.com> Date: Wed, 14 Jun 2023 22:43:02 +0100 Subject: [PATCH] Fix 'Get Installed' for multiple-dependency apps (#835) --- functions/private/Invoke-WinUtilCurrentSystem.ps1 | 8 ++++++-- winutil.ps1 | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/functions/private/Invoke-WinUtilCurrentSystem.ps1 b/functions/private/Invoke-WinUtilCurrentSystem.ps1 index 6612e561..556288ce 100644 --- a/functions/private/Invoke-WinUtilCurrentSystem.ps1 +++ b/functions/private/Invoke-WinUtilCurrentSystem.ps1 @@ -26,8 +26,12 @@ Function Invoke-WinUtilCurrentSystem { $filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPFInstall*"} $sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter} | ForEach-Object { - if($sync.configs.applications.$($psitem.Key).winget -in $sync.InstalledPrograms.Id){ - Write-Output $psitem.name + $dependencies = $($sync.configs.applications.$($psitem.Key).winget -split ";") + + Foreach ($dependency in $dependencies) { + if($dependency -in $sync.InstalledPrograms.Id){ + Write-Output $psitem.name + } } } } diff --git a/winutil.ps1 b/winutil.ps1 index a213dffd..28e36cc3 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -367,8 +367,12 @@ Function Invoke-WinUtilCurrentSystem { $filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPFInstall*"} $sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter} | ForEach-Object { - if($sync.configs.applications.$($psitem.Key).winget -in $sync.InstalledPrograms.Id){ - Write-Output $psitem.name + $dependencies = $($sync.configs.applications.$($psitem.Key).winget -split ";") + + Foreach ($dependency in $dependencies) { + if($dependency -in $sync.InstalledPrograms.Id){ + Write-Output $psitem.name + } } } }