2022-04-13 16:50:06 +00:00
|
|
|
#Function to get Black List apps
|
|
|
|
|
2022-06-10 08:26:41 +00:00
|
|
|
function Get-ExcludedApps {
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2023-01-19 06:11:20 +00:00
|
|
|
if ($GPOList) {
|
|
|
|
|
2023-01-20 02:59:27 +00:00
|
|
|
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList\'
|
|
|
|
$ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList").Property
|
|
|
|
|
2023-01-21 16:37:03 +00:00
|
|
|
if ($ValueNames) {
|
|
|
|
foreach ($ValueName in $ValueNames) {
|
|
|
|
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false)
|
|
|
|
[PSCustomObject]@{
|
|
|
|
Value = $ValueName
|
|
|
|
Data = $AppIDs.Trim()
|
|
|
|
}
|
2023-01-20 02:59:27 +00:00
|
|
|
}
|
|
|
|
|
2023-01-21 16:37:03 +00:00
|
|
|
return $AppIDs
|
|
|
|
|
|
|
|
}
|
2023-01-20 02:59:27 +00:00
|
|
|
|
2023-01-19 06:11:20 +00:00
|
|
|
}
|
|
|
|
elseif (Test-Path "$WorkingDir\excluded_apps.txt") {
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2022-10-18 13:23:39 +00:00
|
|
|
return (Get-Content -Path "$WorkingDir\excluded_apps.txt").Trim() | Where-Object { $_.length -gt 0 }
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2022-03-14 13:55:02 +00:00
|
|
|
}
|
2022-10-26 22:49:10 +00:00
|
|
|
|
2022-09-25 14:54:58 +00:00
|
|
|
}
|