Skip to content

extra_features and extra_capabilities are broken with Windows Server 2025 as host OS #422

Description

@branzo

Hello,

I came into some issues when defining multiple features (or capabilities) to be installed at the same time, as an example:

Set-IniFileValue -Path $configFilePath -Section "Default" -Key "extra_features" -Value "Microsoft-Hyper-V,Microsoft-Hyper-V-Management-Clients"

and/or:

Set-IniFileValue -Path $configFilePath -Section "Default" -Key "extra_capabilities" -Value "OpenSSH.Server,OpenSSH.Client"

It seems that the values are correctly split (by the split(",") by

if ($windowsImageConfig.extra_features) {
                Enable-FeaturesInImage $winImagePath $windowsImageConfig.extra_features.split(",")
            }

if ($windowsImageConfig.extra_packages) {
                foreach ($package in $windowsImageConfig.extra_packages.split(",")) {
                    Add-PackageToImage $winImagePath $package -ignoreErrors $windowsImageConfig.extra_packages_ignore_errors
                }
            }

but then, "Enable-FeaturesInImage" (or Add-PackageToImage) passes a string "Microsoft-Hyper-V Microsoft-Hyper-V-Management-Clients" instead of "Microsoft-Hyper-V" and "Microsoft-Hyper-V-Management-Clients" to dism.exe.

Contrary to what's been reported in this PR, if the value is unquoted, Set-IniFileValue complains about not being able to convert the value into System.String.

Host OS: Windows Server 2025
Powershell version: 5.1.26100.7462

Regards,
B.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions