diff --git a/src/chocolatey.resources/helpers/functions/UnInstall-ChocolateyZipPackage.ps1 b/src/chocolatey.resources/helpers/functions/UnInstall-ChocolateyZipPackage.ps1 index 89ab57fece..c384c66c2b 100644 --- a/src/chocolatey.resources/helpers/functions/UnInstall-ChocolateyZipPackage.ps1 +++ b/src/chocolatey.resources/helpers/functions/UnInstall-ChocolateyZipPackage.ps1 @@ -65,8 +65,10 @@ param( if ((Test-Path -path $zipContentFile)) { $zipContentFile $zipContents=get-content $zipContentFile - foreach ($fileInZip in $zipContents) { - remove-item -Path "$fileInZip" -ErrorAction SilentlyContinue -Recurse -Force + foreach ($fileInZip in $zipContents) { + if ($fileInZip -ne $null -and $fileInZip.Trim() -ne '') { + Remove-Item -Path "$fileInZip" -ErrorAction SilentlyContinue -Recurse -Force + } } } }