wingetautoupdate/Sources/WAU/Winget-AutoUpdate/functions/Get-ExcludedApps.ps1

30 lines
875 B
PowerShell
Raw Normal View History

2023-03-31 15:56:07 +00:00
#Function to get the Block List apps
2022-04-13 16:50:06 +00:00
function Get-ExcludedApps {
if ($GPOList) {
if (Test-Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList") {
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList\'
$ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList").Property
$AppIDs = @()
foreach ($ValueName in $ValueNames) {
$AppIDs += (Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList" -Name $ValueName)
}
}
return $AppIDs | Where-Object { $_.length -gt 0 }
}
elseif (Test-Path "$WorkingDir\excluded_apps.txt") {
return (Get-Content -Path "$WorkingDir\excluded_apps.txt").Trim() | Where-Object { $_.length -gt 0 }
}
2022-09-25 14:54:58 +00:00
}