diff --git a/src/chocolatey.console/Program.cs b/src/chocolatey.console/Program.cs index 00029ab0b1..a4359948b9 100644 --- a/src/chocolatey.console/Program.cs +++ b/src/chocolatey.console/Program.cs @@ -165,7 +165,8 @@ private static void Main(string[] args) private static void warn_on_nuspec_or_nupkg_usage(string[] args, ChocolateyConfiguration config) { - if (!args.Any(a => a.contains("pack") || a.contains("push")) && args.Any(a => a.contains(".nupkg") || a.contains(".nuspec"))) + var commandLine = Environment.CommandLine; + if (!(commandLine.contains(" pack ") || commandLine.contains(" push ")) && (commandLine.contains(".nupkg") || commandLine.contains(".nuspec"))) { if (config.RegularOutput) "chocolatey".Log().Warn("The use of .nupkg or .nuspec in for package name or source is known to cause issues. Please use the package id from the nuspec `` with `-s .` (for local folder where nupkg is found)."); }