2023-03-31 15:56:07 +00:00
|
|
|
#Function to get the Block List apps
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2023-10-03 08:18:00 +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
|
|
|
|
|
2024-03-06 15:39:37 +00:00
|
|
|
$AppIDs = @()
|
|
|
|
|
2023-10-03 08:18:00 +00:00
|
|
|
foreach ($ValueName in $ValueNames) {
|
2024-03-06 15:39:37 +00:00
|
|
|
$AppIDs += (Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList" -Name $ValueName)
|
2023-01-20 02:59:27 +00:00
|
|
|
}
|
2023-10-03 08:18:00 +00:00
|
|
|
|
|
|
|
}
|
2024-03-06 15:39:37 +00:00
|
|
|
return $AppIDs | Where-Object { $_.length -gt 0 }
|
2023-10-03 08:18:00 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
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
|
|
|
}
|