Winget-cli: Turn Windows features on and off

Created on 4 Sep 2020  路  6Comments  路  Source: microsoft/winget-cli

Part of my setup is using Docker for Windows, obviously it works best with WSL2.

It would be nice to be able to turn things on in windows for my setup to be complete.

Issue-Feature

Most helpful comment

Sorry but that's really just Install-WindowsFeature Telnet-Client in PowerShell with less ambiguity about what's going to happen. Or alternatively dism /online /Enable-Feature /FeatureName:TelnetClient with DISM.

All 6 comments

This can be done easily with PowerShell or the Deployment Image Servicing and Management (DISM) tool. I don't see how winget would help with that...

It would be nice if winget install telnet turned on telnet in Windows features.

Sorry but that's really just Install-WindowsFeature Telnet-Client in PowerShell with less ambiguity about what's going to happen. Or alternatively dism /online /Enable-Feature /FeatureName:TelnetClient with DISM.

It would help for installing the RSAT, since that's been split up into 20-someodd packages in optional features. Chocolatey has a choco install rsat that installs all of them via a PowerShell script.

Maybe PowerShell script support as an installer type would be the real feature request? Although that may encourage bad habits, since people could bypass the manifest creation step and put all of the logic inside of a non-standard script which then has to be debugged in a different way.

If all you know is a hammer everything looks like a nail.

I'm a strong proponent of using the right tool for the job and the RSAT installation in PowerShell really is just a single line:

#### Client OS (Windows 10) - uses DISM behind the scenes

# List RSAT components that are not installed
Get-WindowsCapability -Name RSAT* -Online | Where-Object { $_.State -eq "NotPresent" }

# Install all RSAT components
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability 鈥揙nline


#### Server OS (Server 201X) - uses Server Manager behind the scenes

# List RSAT components that are not installed
Get-WindowsFeature -Name RSAT* | Where-Object { $_.Installed -ne $true }

# Install all RSAT components
Install-WindowsFeature -Name RSAT -IncludeAllSubFeature -IncludeManagementTools

See https://hahndorf.eu/blog/WindowsFeatureViaCmd for details.

This could be part of #163 "Support for package dependencies". If you winget install ubuntu we should be able to see if WSL is enabled or not, and take care of that for you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

denelon picture denelon  路  4Comments

jasperweiss picture jasperweiss  路  3Comments

sayedarifuddin picture sayedarifuddin  路  3Comments

auchenberg picture auchenberg  路  3Comments

sob picture sob  路  5Comments