Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blacklist doesn't exist in GPO error message #647

Closed
KnifMelti opened this issue Jul 13, 2024 Discussed in #640 · 1 comment
Closed

Blacklist doesn't exist in GPO error message #647

KnifMelti opened this issue Jul 13, 2024 Discussed in #640 · 1 comment

Comments

@KnifMelti
Copy link
Contributor

Discussed in #640

Originally posted by Andrew-Griggs June 21, 2024
Hi all, I'm testing various configurations and I can't seem to get the blacklist working. Every update cycle throws the following error:

################################################################

21/06/2024 - CHECK FOR APP UPDATES (System context - Connected user)

################################################################
18:52:53 - WAU Policies management Enabled.
18:52:53 - Notification Level: Full. Notification Language: English
18:52:53 - Checking internet connection...
18:52:53 - Connected !
18:52:53 - Winget Version: v1.7.11261
18:52:53 - WAU current version: 1.20.1
18:52:53 - WAU AutoUpdate is Enabled.
18:52:54 - WAU is up to date.
18:52:54 - WAU uses External Lists from: GPO
18:52:54 - WAU uses Black List config
18:52:54 - Critical: Blacklist doesn't exist in GPO, exiting...

I can't see what I'm missing in my config though, here's the policies downloaded from Intune:

image

image

What am I missing? Interestingly, if I switch to a whitelist approach everything works perfectly.

@KnifMelti
Copy link
Contributor Author

From line 239 in Winget-Upgrade.ps1 avoid $toUpdate/$toSkip.GetUpperBound(0), change to:

        #Fix and count the array if GPO List as ERROR handling!
        if ($GPOList) {
            if ($UseWhiteList) {
                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 {
                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
                }
                foreach ($app in $toSkip) { Write-ToLog "Exclude app ${app}" }
            }
        }

Romanitho added a commit that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant