When creating an OSBuild for Windows 10, your have the option to remove an installed Windows Capability
New-OSBuildTask -TaskName Demo -RemoveWindowsCapability
The selected Windows Capabilities will be added to the OSBuild Task. When executing New-OSBuild, these Windows Capabilities will be removed