diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 index 0212e5c..610b0d1 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1 @@ -10,16 +10,14 @@ function Get-ExcludedApps { $ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList").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\BlackList" -Name $ValueName) } } - return $AppIDs + return $AppIDs | Where-Object { $_.length -gt 0 } } elseif (Test-Path "$WorkingDir\excluded_apps.txt") {