Small bits
parent
de8f32b50e
commit
021170b72b
|
@ -200,21 +200,21 @@ if (Test-Network) {
|
|||
if ($GPOList) {
|
||||
if ($UseWhiteList) {
|
||||
$WhiteApps = $toUpdate.GetUpperBound(0)
|
||||
$toUpdate = $toUpdate.Data
|
||||
if ($null -eq $WhiteApps) {
|
||||
Write-Log "Critical: White List doesn't exist in GPO, exiting..." "Red"
|
||||
New-Item "$WorkingDir\logs\error.txt" -Value "White List doesn't exist in GPO!" -Force
|
||||
Exit 1
|
||||
}
|
||||
$toUpdate = $toUpdate.Data
|
||||
}
|
||||
else {
|
||||
$BlackApps = $toSkip.GetUpperBound(0)
|
||||
$toSkip = $toSkip.Data
|
||||
if ($null -eq $BlackApps) {
|
||||
Write-Log "Critical: Black List doesn't exist in GPO, exiting..." "Red"
|
||||
New-Item "$WorkingDir\logs\error.txt" -Value "Black List doesn't exist in GPO!" -Force
|
||||
Exit 1
|
||||
}
|
||||
$toSkip = $toSkip.Data
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,15 +7,18 @@ function Get-ExcludedApps {
|
|||
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList\'
|
||||
$ValueNames = (Get-Item -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate\BlackList").Property
|
||||
|
||||
foreach ($ValueName in $ValueNames) {
|
||||
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false)
|
||||
[PSCustomObject]@{
|
||||
Value = $ValueName
|
||||
Data = $AppIDs.Trim()
|
||||
if ($ValueNames) {
|
||||
foreach ($ValueName in $ValueNames) {
|
||||
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false)
|
||||
[PSCustomObject]@{
|
||||
Value = $ValueName
|
||||
Data = $AppIDs.Trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $AppIDs
|
||||
return $AppIDs
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
elseif (Test-Path "$WorkingDir\excluded_apps.txt") {
|
||||
|
|
|
@ -6,17 +6,19 @@ function Get-IncludedApps {
|
|||
|
||||
$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]@{
|
||||
Value = $ValueName
|
||||
Data = $AppIDs.Trim()
|
||||
|
||||
if ($ValueNames) {
|
||||
foreach ($ValueName in $ValueNames) {
|
||||
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false)
|
||||
[PSCustomObject]@{
|
||||
Value = $ValueName
|
||||
Data = $AppIDs.Trim()
|
||||
}
|
||||
}
|
||||
|
||||
return $AppIDs
|
||||
}
|
||||
|
||||
return $AppIDs
|
||||
|
||||
|
||||
}
|
||||
elseif (Test-Path "$WorkingDir\included_apps.txt") {
|
||||
|
||||
|
|
Loading…
Reference in New Issue