Update Get-ExcludedApps.ps1
Fix Get-ExcludedApps where GPO is in use to properly generate the arraypull/580/head
parent
59a4cc0771
commit
608c0e95ca
|
@ -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") {
|
||||
|
|
Loading…
Reference in New Issue