diff --git a/Windows/Chocolatey/ChocolateyUninstall.ps1 b/Windows/Chocolatey/ChocolateyUninstall.ps1 index a4d0c7c15d8cd2f5927b6da669bd0243f658a387..4ff570f0cca12632131da475e910af32bd6f4406 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."