Last edit, Done!

pull/263/head
KnifMelti 2023-01-21 18:20:57 +01:00
parent 021170b72b
commit 76e3b4bc22
2 changed files with 14 additions and 11 deletions

View File

@ -4,10 +4,12 @@ function Get-ExcludedApps {
if ($GPOList) {
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList\'
$ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList").Property
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
if ($ValueNames) {
foreach ($ValueName in $ValueNames) {
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false)
[PSCustomObject]@{
@ -15,10 +17,9 @@ function Get-ExcludedApps {
Data = $AppIDs.Trim()
}
}
return $AppIDs
}
return $AppIDs
}
elseif (Test-Path "$WorkingDir\excluded_apps.txt") {

View File

@ -4,10 +4,12 @@ function Get-IncludedApps {
if ($GPOList) {
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList\'
$ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList").Property
if (Test-Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList") {
if ($ValueNames) {
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList\'
$ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\WhiteList").Property
foreach ($ValueName in $ValueNames) {
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false)
[PSCustomObject]@{
@ -16,9 +18,9 @@ function Get-IncludedApps {
}
}
return $AppIDs
}
return $AppIDs
}
elseif (Test-Path "$WorkingDir\included_apps.txt") {