diff --git a/scripts/package-cleanup/Remove-BrokenPackages.ps1 b/scripts/package-cleanup/Remove-BrokenPackages.ps1 index 3c9fef1..ad93167 100644 --- a/scripts/package-cleanup/Remove-BrokenPackages.ps1 +++ b/scripts/package-cleanup/Remove-BrokenPackages.ps1 @@ -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 @@ -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 = @() diff --git a/scripts/package-cleanup/whitelist_packages.csv b/scripts/package-cleanup/whitelist_packages.csv new file mode 100644 index 0000000..4564346 --- /dev/null +++ b/scripts/package-cleanup/whitelist_packages.csv @@ -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 \ No newline at end of file