Skip to content

Commit

Permalink
add whitelist to package cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mnich committed Oct 27, 2024
1 parent b70a392 commit de4d213
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/package-cleanup/Remove-BrokenPackages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Import-Module Microsoft.WinGet.Client
$ErrorActionPreference = "Stop"

$DRY_RUN = $false
$USE_WHITELIST = $true
$REMOVE_HIGHEST_VERSIONS = $false
#$timeoutSeconds = 60 # Set your desired timeout in seconds

Expand Down Expand Up @@ -35,6 +36,17 @@ $brokenPackageFileAbsolutePath = $brokenPackagesFiles[0].FullName

$packages = Import-Csv -Path $brokenPackageFileAbsolutePath
$ignored_packages = Import-Csv -Path $scriptDirectory\ignored_packages.csv
$whitelist_packages = Import-Csv -Path $scriptDirectory\whitelist_packages.csv

$whitelistDict = @{}
foreach ($whitelist in $whitelist_packages) {
$whitelistDict[$whitelist.package_identifier] = $whitelist.package_identifier
}

# filter out packages that are not in whitelist
if($USE_WHITELIST -eq $true) {
$packages = $packages | Where-Object { $whitelistDict.ContainsKey($_.package_identifier) }
}

$successfullPackages = @()
#$timeoutPackages = @()
Expand Down
17 changes: 17 additions & 0 deletions scripts/package-cleanup/whitelist_packages.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package_identifier
Bin-Huang.Chatbox
calibre.calibre.portable
GeoGebra.Classic
GeoGebra.Geometry
GeoGebra.GraphingCalculator
GoHarbor.Harbor
IurieNistor.GeonkickPlugin
Jellyfin.Server
LGUG2Z.komorebi.Nightly
ArmCord.ArmCord
Aserto.Topaz
Bin-Huang.Chatbox
NagleCode.PacketSender
RingCentral.RingCentral
SmartSoft.SmartFTP
Wondershare.PDFelement.9

0 comments on commit de4d213

Please sign in to comment.