-
Notifications
You must be signed in to change notification settings - Fork 143
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
Fix for Group Policy enforced include/exclude lists not being imported corrected #580
Conversation
Fix Get-ExcludedApps where GPO is in use to properly generate the array
Updated Get-IncludedApps to work correctly with GPO source.
add log for excluded / included apps
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false) | ||
[PSCustomObject]@{ | ||
Value = $ValueName | ||
Data = $AppIDs.Trim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we keep the Trim control?
$AppIDs = [Microsoft.Win32.Registry]::GetValue($Key, $ValueName, $false) | ||
[PSCustomObject]@{ | ||
Value = $ValueName | ||
Data = $AppIDs.Trim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we keep the Trim control?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add that back in and updated the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing 😇
@@ -245,7 +245,8 @@ if (Test-Network) { | |||
New-Item "$WorkingDir\logs\error.txt" -Value "Whitelist doesn't exist in GPO" -Force | |||
Exit 1 | |||
} | |||
$toUpdate = $toUpdate.Data | |||
$toUpdate = $toUpdate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be removed ?
@@ -254,7 +255,8 @@ if (Test-Network) { | |||
New-Item "$WorkingDir\logs\error.txt" -Value "Blacklist doesn't exist in GPO" -Force | |||
Exit 1 | |||
} | |||
$toSkip = $toSkip.Data | |||
$toSkip = $toSkip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep that'd be the same, I've removed that whole line now
I went through different path.. |
Added the uri fetching. It does seem odd you are creating custom objects (key value pair) then ignoring those in the main code base, question if that is needed or you just need an array of the items, which is what I'm doing. I'm mainly focused on the excluded apps section, as the original code wasn't fully working. New code does seem happy though it can always be slightly optimized |
II just expanded the function. How it is handled RN in the calling scriptblock was not adjusted at 11PM. I am aware of ongoing discussion about that $appIds.Data thread.
BR
AD
…________________________________
From: Nick Brown ***@***.***>
Sent: 15 March 2024 10:42
To: Romanitho/Winget-AutoUpdate ***@***.***>
Cc: Andrzej Demski ***@***.***>; Comment ***@***.***>
Subject: Re: [Romanitho/Winget-AutoUpdate] Fix for Group Policy enforced include/exclude lists not being imported corrected (PR #580)
Added the uri fetching. It does seem odd you are creating custom objects (key value pair) then ignoring those in the main code base, question if that is needed or you just need an array of the items, which is what I'm doing.
I'm mainly focused on the excluded apps section, as the original code wasn't fully working. New code does seem happy though it can always be slightly optimized
—
Reply to this email directly, view it on GitHub<#580 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASAJCPT7I6GYDOT4YEFADN3YYK677AVCNFSM6AAAAABEJJRW26VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJZGI4DGOJVG4>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Proposed Changes
Fix for Group Policy enforced include/exclude lists not being imported corrected.
Previously the GPO allow/block list wasn't getting imported correctly, (empty array), this fixes that by using native powershell registry calls