2023-09-15 14:33:51 +00:00
|
|
|
# Function to get the allow List apps
|
|
|
|
|
2023-09-15 14:38:54 +00:00
|
|
|
function Get-IncludedApps
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
2023-09-15 14:38:54 +00:00
|
|
|
if ($GPOList)
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
2023-09-15 14:38:54 +00:00
|
|
|
if (Test-Path -Path 'HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList' -ErrorAction SilentlyContinue)
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
|
|
|
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList\'
|
|
|
|
$ValueNames = (Get-Item -Path 'HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList').Property
|
2023-09-15 14:38:54 +00:00
|
|
|
|
|
|
|
foreach ($ValueName in $ValueNames)
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
|
|
|
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false)
|
|
|
|
[PSCustomObject]@{
|
|
|
|
Value = $ValueName
|
|
|
|
Data = $AppIDs.Trim()
|
2023-01-20 02:59:27 +00:00
|
|
|
}
|
2023-09-15 14:33:51 +00:00
|
|
|
}
|
|
|
|
}
|
2023-09-15 14:38:54 +00:00
|
|
|
|
2023-09-15 14:33:51 +00:00
|
|
|
return $AppIDs
|
|
|
|
}
|
2023-09-15 14:38:54 +00:00
|
|
|
elseif (Test-Path -Path ('{0}\included_apps.txt' -f $WorkingDir) -ErrorAction SilentlyContinue)
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
|
|
|
return (Get-Content -Path ('{0}\included_apps.txt' -f $WorkingDir)).Trim() | Where-Object -FilterScript {
|
2023-09-15 14:38:54 +00:00
|
|
|
$_.length -gt 0
|
2023-09-15 14:33:51 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-25 14:54:58 +00:00
|
|
|
}
|