From 3ca8269b522be68d8c5cd6ff026bc7e2c2670b8e Mon Sep 17 00:00:00 2001 From: Andreas Lindemark <andreas.lindemark@liu.se> Date: Fri, 4 Apr 2025 17:57:10 +0200 Subject: [PATCH] Added more package exclusions to part that list current installed packages. --- Windows/Chocolatey/ChocolateyUninstall.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Windows/Chocolatey/ChocolateyUninstall.ps1 b/Windows/Chocolatey/ChocolateyUninstall.ps1 index a4d0c7c..4ff570f 100644 --- a/Windows/Chocolatey/ChocolateyUninstall.ps1 +++ b/Windows/Chocolatey/ChocolateyUninstall.ps1 @@ -12,7 +12,7 @@ $outputFilePath = ".\ChocoInstall_$computerName.ps1" # Check if Chocolatey is installed before listing packages if (Test-ChocolateyInstalled) { # List all installed Chocolatey packages and save to the output file - $installedPackages = choco list --no-color | Select-String -Pattern "^[^ ]+" | Where-Object { $_ -notmatch "Chocolatey v" -and $_ -notmatch "packages installed" -and $_ -notmatch "^chocolatey" -and $_ -notmatch "^KB" } | ForEach-Object { "choco install -y " + ($_ -split ' ')[0] } + $installedPackages = choco list --no-color | Select-String -Pattern "^[^ ]+" | Where-Object { $_ -notmatch "Chocolatey v" -and $_ -notmatch "packages installed" -and $_ -notmatch "^chocolatey" -and $_ -notmatch "^KB" -and $_ -notmatch "^adobereader" -and $_ -notmatch "^powershell-core" -and $_ -notmatch "^nano" -and $_ -notmatch "^nano-win" } | ForEach-Object { "choco install -y " + ($_ -split ' ')[0] } $installedPackages | Out-File -FilePath $outputFilePath } else { Write-Output "Chocolatey is not installed on this system." -- GitLab