From 7bbc406706c96e20a7d78f0e7122a622153782a5 Mon Sep 17 00:00:00 2001 From: Nick Brown <109540830+nickjisc@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:40:10 +0000 Subject: [PATCH] Update Get-IncludedApps.ps1 Updated Get-IncludedApps to work correctly with GPO source. --- .../WAU/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 index ae2a8ad..14d8aee 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Get-IncludedApps.ps1 @@ -10,12 +10,10 @@ function Get-IncludedApps { $ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList").Property + $AppIDs = @() + foreach ($ValueName in $ValueNames) { - $AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false) - [PSCustomObject]@{ - Value = $ValueName - Data = $AppIDs.Trim() - } + $AppIDs += (Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList" -Name $ValueName) } }