Skip to content
Snippets Groups Projects
Commit 3ca8269b authored by Andreas Lindemark's avatar Andreas Lindemark
Browse files

Added more package exclusions to part that list current installed packages.

parent 1d03b4c4
No related branches found
No related tags found
No related merge requests found
......@@ -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."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment