diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index cb33c4e80c..8804f83997 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -332,7 +332,15 @@ private bool package_is_a_dependency_not_a_virtual(ChocolateyConfiguration confi { foreach (var package in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null()) { - if (packageName.is_equal_to(package) || packageName.contains(package + ".")) + if (packageName.is_equal_to(package) + || packageName.contains(package + ".") + || (packageName.contains(package) + && (packageName.contains(".nupkg") + || packageName.contains(".nuspec") + || packageName.contains("\\") + ) + ) + ) { return false; }