Skip to content

Commit

Permalink
Merge pull request #648 from KnifMelti/Fix_for_#647
Browse files Browse the repository at this point in the history
Fix for #647 (GPO issue)
  • Loading branch information
Romanitho authored Jul 17, 2024
2 parents 0f0591d + 8bb705f commit 87715a3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,15 @@ if (Test-Network) {
#Fix and count the array if GPO List as ERROR handling!
if ($GPOList) {
if ($UseWhiteList) {
$WhiteList = $toUpdate.GetUpperBound(0)
if ($null -eq $WhiteList) {
if (-not $toUpdate) {
Write-ToLog "Critical: Whitelist doesn't exist in GPO, exiting..." "Red"
New-Item "$WorkingDir\logs\error.txt" -Value "Whitelist doesn't exist in GPO" -Force
Exit 1
}
foreach ($app in $toUpdate) { Write-ToLog "Include app ${app}" }
}
else {
$BlackList = $toSkip.GetUpperBound(0)
if ($null -eq $BlackList) {
if (-not $toSkip) {
Write-ToLog "Critical: Blacklist doesn't exist in GPO, exiting..." "Red"
New-Item "$WorkingDir\logs\error.txt" -Value "Blacklist doesn't exist in GPO" -Force
Exit 1
Expand Down

0 comments on commit 87715a3

Please sign in to comment.