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

View File

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