chocolatey/choco · error · NotImplementedException

Alternative sources do not allow the use of the 'all' packag

Error message

Alternative sources do not allow the use of the 'all' package name/keyword.

What it means

Thrown by WindowsFeatureService.Install when the resolved package names equal the 'all' keyword (ApplicationParameters.AllPackages). Alternative sources (Windows Features, Python, Ruby, Cygwin, etc.) cannot install every available item at once the way the normal Chocolatey feed can, so 'all' is explicitly rejected as not implemented for these source types.

Source

Thrown at src/chocolatey/infrastructure.app/services/WindowsFeatureService.cs:292

        }

        public void InstallDryRun(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)
        {
            EnsureExecutablePathSet();
            var args = BuildArguments(config, _installArguments);
            this.Log().Info("Would have run '{0} {1}'".FormatWith(_exePath.EscapeCurlyBraces(), args.EscapeCurlyBraces()));
        }

        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)
        {
            return Install(config, continueAction, beforeModifyAction: null);
        }

        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction, Action<PackageResult, ChocolateyConfiguration> beforeModifyAction)
        {
            if (config.PackageNames.IsEqualTo(ApplicationParameters.AllPackages))
            {
                throw new NotImplementedException("Alternative sources do not allow the use of the 'all' package name/keyword.");
            }

            EnsureExecutablePathSet();
            var args = BuildArguments(config, _installArguments);
            var packageResults = new ConcurrentDictionary<string, PackageResult>(StringComparer.InvariantCultureIgnoreCase);

            foreach (var packageToInstall in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries))
            {
                var packageName = packageToInstall;
                var results = packageResults.GetOrAdd(packageToInstall, new PackageResult(packageName, null, null));
                var argsForPackage = args.Replace(PackageNameToken, packageName);

                //todo: #2574 detect windows feature is already enabled
                /*
                      $checkStatement=@"
                    `$dismInfo=(cmd /c `"$dism /Online /Get-FeatureInfo /FeatureName:$packageName`")
                    if(`$dismInfo -contains 'State : Enabled') {return}
                    if(`$dismInfo -contains 'State : Enable Pending') {return}

View on GitHub (pinned to 0d5abdd10c)

Solutions

  1. Replace 'all' with an explicit, comma-separated list of the Windows feature names you want (e.g. choco install TelnetClient,IIS-WebServer --source windowsfeatures).
  2. Query available features first with `choco search --source windowsfeatures` or `Get-WindowsFeature` to enumerate exact names.
  3. If you genuinely need bulk install of all features, script the enumeration and install each feature by name in a loop.

Example fix

// before
choco install all --source windowsfeatures

// after
choco install TelnetClient,IIS-WebServer --source windowsfeatures
Defensive patterns

Strategy: validation

Validate before calling

var names = config.PackageNames
    .Split(ApplicationParameters.PackageNamesSeparator)
    .Select(n => n.Trim())
    .Where(n => !string.IsNullOrWhiteSpace(n));
if (names.Any(n => n.IsEqualTo(ApplicationParameters.AllPackages)))
{
    throw new InvalidOperationException(
        "The 'all' keyword is not supported for alternative sources. " +
        "Enumerate features explicitly via choco search --source windowsfeatures.");
}

Try / catch

try
{
    service.Install(config, continueAction);
}
catch (NotImplementedException ex) when (ex.Message.Contains("'all'"))
{
    logger.Error("Cannot use 'all' with this source. Specify explicit feature names.");
}

Prevention

When it happens

Trigger: Running `choco install all --source windowsfeatures` (or any other alternative source routed through WindowsFeatureService) where config.PackageNames resolves to the AllPackages token. The guard config.PackageNames.IsEqualTo(ApplicationParameters.AllPackages) matches case-insensitively before any argument building.

Common situations: Scripts or automation that blindly pass 'all' as the package name get reused when switching a source from the default Chocolatey feed to windowsfeatures. Users assuming 'choco install all' semantics carry over to every source type.

Related errors


AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13). Data as JSON: /api/errors/13b465ba3427ed50. Report an issue: GitHub.