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