Use o Windows PowerShell para instalar recursos opcionais

Experimente Nosso Instrumento Para Eliminar Problemas

O Microsoft Windows é fornecido com um conjunto dos chamados recursos opcionais que os usuários podem ativar ou desativar usando o miniaplicativo do painel de controle 'ativar ou desativar recursos do Windows'.

Isso funciona bem na maior parte, mas requer que você abra o painel de controle no sistema operacional, a menos que você carregue a janela Recursos diretamente digitando recursos opcionais em Iniciar .

Embora isso seja suficiente na maioria das vezes, os administradores podem usar o PowerShell também para gerenciar recursos opcionais do sistema operacional Windows.

O guia a seguir fornece uma visão geral de como isso funciona no Windows 10. Observe que isso pode não funcionar em versões anteriores do Windows, como o Windows 7.

Windows PowerShell: instale recursos opcionais

Você precisa de um PowerShell elevado para os comandos a seguir. Toque na tecla Windows, digite powershell, mantenha pressionadas as teclas Ctrl e Shift e toque na tecla Enter para abrir um prompt do PowerShell com privilégios administrativos.

Liste todos os recursos opcionais e seus status

powershell optional features

A primeira coisa que você pode querer fazer, pelo menos quando você é novo no uso do comando, é exibir a lista de recursos que estão disponíveis.

Corre get-windowsoptionalfeature -online para listar todos os nomes de recursos disponíveis e seus estados no sistema de computador. O estado é habilitado ou desabilitado.

Nota: o parâmetro -online significa que as ações são executadas no dispositivo atual.

Embora seja fácil identificar alguns recursos pelo nome do recurso, não é fácil para todos eles.

A lista a seguir é de um Windows 10 Pro versão 1809

  • FeatureName: Printing-PrintToPDFServices-Features
  • FeatureName: Windows-Defender-Default-Definitions
  • FeatureName: Printing-XPSServices-Features
  • FeatureName: SearchEngine-Client-Package
  • FeatureName: MSRDC-Infrastructure
  • FeatureName: TelnetClient
  • FeatureName: TFTP
  • FeatureName: TIFFIFilter
  • FeatureName: WorkFolders-Client
  • FeatureName: LegacyComponents
  • FeatureName: DirectPlay
  • FeatureName: Printing-Foundation-Features
  • FeatureName: FaxServicesClientPackage
  • Nome do recurso: Printing-Foundation-InternetPrinting-Client
  • Nome do recurso: Printing-Foundation-LPDPrintService
  • FeatureName: Printing-Foundation-LPRPortMonitor
  • FeatureName: SimpleTCP
  • FeatureName: MicrosoftWindowsPowerShellV2Root
  • FeatureName: MicrosoftWindowsPowerShellV2
  • FeatureName: Windows-Identity-Foundation
  • FeatureName: Microsoft-Windows-Subsystem-Linux
  • FeatureName: HypervisorPlatform
  • FeatureName: VirtualMachinePlatform
  • FeatureName: Client-ProjFS
  • Nome do recurso: NetFx4-AdvSrvs
  • Nome do recurso: NetFx4Extended-ASPNET45
  • FeatureName: IIS-WebServerRole
  • FeatureName: IIS-WebServer
  • FeatureName: IIS-CommonHttpFeatures
  • FeatureName: IIS-HttpErrors
  • FeatureName: IIS-HttpRedirect
  • FeatureName: IIS-ApplicationDevelopment
  • FeatureName: IIS-NetFxExtensibility
  • FeatureName: IIS-NetFxExtensibility45
  • FeatureName: IIS-HealthAndDiagnostics
  • FeatureName: IIS-HttpLogging
  • FeatureName: IIS-LoggingLibraries
  • FeatureName: IIS-RequestMonitor
  • FeatureName: IIS-HttpTracing
  • FeatureName: IIS-Security
  • FeatureName: IIS-URLAuthorization
  • FeatureName: IIS-RequestFiltering
  • FeatureName: IIS-IPSecurity
  • FeatureName: IIS-Performance
  • FeatureName: IIS-HttpCompressionDynamic
  • FeatureName: IIS-WebServerManagementTools
  • FeatureName: IIS-ManagementScriptingTools
  • FeatureName: IIS-IIS6ManagementCompatibility
  • FeatureName: IIS-Metabase
  • FeatureName: WAS-WindowsActivationService
  • FeatureName: WAS-ProcessModel
  • FeatureName: WAS-NetFxEnvironment
  • FeatureName: WAS-ConfigurationAPI
  • FeatureName: IIS-HostableWebCore
  • FeatureName: IIS-StaticContent
  • FeatureName: IIS-DefaultDocument
  • FeatureName: IIS-DirectoryBrowsing
  • FeatureName: IIS-WebDAV
  • FeatureName: IIS-WebSockets
  • FeatureName: IIS-ApplicationInit
  • FeatureName: IIS-ASPNET
  • FeatureName: IIS-ASPNET45
  • FeatureName: IIS-ASP
  • FeatureName: IIS-CGI
  • FeatureName: IIS-ISAPIExtensions
  • FeatureName: IIS-ISAPIFilter
  • FeatureName: IIS-ServerSideIncludes
  • FeatureName: IIS-CustomLogging
  • FeatureName: IIS-BasicAuthentication
  • FeatureName: IIS-HttpCompressionStatic
  • FeatureName: IIS-ManagementConsole
  • FeatureName: IIS-ManagementService
  • FeatureName: IIS-WMICompatibility
  • FeatureName: IIS-LegacyScripts
  • FeatureName: IIS-LegacySnapIn
  • FeatureName: IIS-FTPServer
  • FeatureName: IIS-FTPSvc
  • FeatureName: IIS-FTPExtensibility
  • FeatureName: WCF-Services45
  • FeatureName: WCF-HTTP-Activation45
  • FeatureName: WCF-TCP-Activation45
  • FeatureName: WCF-Pipe-Activation45
  • FeatureName: WCF-MSMQ-Activation45
  • FeatureName: WCF-TCP-PortSharing45
  • FeatureName: MSMQ-Container
  • FeatureName: MSMQ-Server
  • FeatureName: MSMQ-Triggers
  • FeatureName: MSMQ-ADIntegration
  • FeatureName: MSMQ-HTTP
  • FeatureName: MSMQ-Multicast
  • Nome do recurso: MSMQ-DCOMProxy
  • FeatureName: WCF-HTTP-Activation
  • FeatureName: WCF-NonHTTP-Activation
  • FeatureName: IIS-CertProvider
  • FeatureName: IIS-WindowsAuthentication
  • FeatureName: IIS-DigestAuthentication
  • FeatureName: IIS-ClientCertificateMappingAuthentication
  • FeatureName: US-IISCertificateMappingAuthentication
  • FeatureName: IIS-ODBCLogging
  • FeatureName: NetFx3
  • FeatureName: SMB1Protocol
  • Nome do recurso: SMB1Protocol-Client
  • Nome do recurso: SMB1Protocol-Server
  • FeatureName: SMB1Protocol-Deprecation
  • FeatureName: MediaPlayback
  • FeatureName: WindowsMediaPlayer
  • FeatureName: Microsoft-Windows-NetFx3-OC-Package
  • FeatureName: Microsoft-Windows-NetFx4-US-OC-Package
  • FeatureName: Microsoft-Windows-Client-EmbeddedExp-Package
  • FeatureName: Microsoft-Windows-NetFx3-WCF-OC-Package
  • FeatureName: Microsoft-Windows-NetFx4-WCF-US-OC-Package
  • FeatureName: Containers-DisposableClientVM
  • FeatureName: Microsoft-Hyper-V-All
  • Nome do recurso: Microsoft-Hyper-V
  • FeatureName: Microsoft-Hyper-V-Tools-All
  • FeatureName: Microsoft-Hyper-V-Management-PowerShell
  • FeatureName: Microsoft-Hyper-V-Hypervisor
  • FeatureName: Microsoft-Hyper-V-Services
  • FeatureName: Microsoft-Hyper-V-Management-Clients
  • FeatureName: HostGuardian
  • FeatureName: Client-DeviceLockdown
  • FeatureName: Client-EmbeddedShellLauncher
  • FeatureName: Client-EmbeddedBootExp
  • FeatureName: Client-EmbeddedLogon
  • FeatureName: Client-KeyboardFilter
  • FeatureName: Client-UnifiedWriteFilter
  • FeatureName: DataCenterBridging
  • FeatureName: DirectoryServices-ADAM-Client
  • FeatureName: Windows-Defender-ApplicationGuard
  • FeatureName: ServicesForNFS-ClientOnly
  • FeatureName: ClientForNFS-Infrastructure
  • FeatureName: NFS-Administration
  • FeatureName: Containers
  • FeatureName: SmbDirect
  • FeatureName: MultiPoint-Connector
  • FeatureName: MultiPoint-Connector-Services
  • FeatureName: MultiPoint-Tools
  • FeatureName: AppServerClient
  • FeatureName: Internet-Explorer-Optional-amd64

Exibir informações sobre recursos

powershell-display information about features

Você pode usar o parâmetro -featurename Example para exibir informações detalhadas sobre um recurso no qual está interessado.

O comando get-windowsoptionalfeature -online -featurename NetFx 3, por exemplo, revela que isso instala o .Net Framework 3.5 no sistema. Também existe um link de Internet no qual você pode clicar para procurar informações adicionais online.

Habilite ou desabilite um recurso opcional

Você pode usar comandos do PowerShell para habilitar ou desabilitar recursos opcionais em uma máquina com Windows 10.

Os comandos Enable-WindowsOptionalFeature -FeatureName e Disable-WindowsOptionalFeature -FeatureName são usados ​​para isso.

Para lhe dar dois exemplos para mostrar como isso funciona:

  • Enable-WindowsOptionalFeature -Online -FeatureName 'NetFx3' -Todos - Este comando instala o Net Framework 3.5 no computador em que o comando é executado.
  • Disable-WindowsOptionalFeature -Online -FeatureName 'NetFx3' - Este comando desativa o recurso novamente.

O parâmetro -All informa ao Windows para instalar todas as dependências também. Portanto, se um recurso pai for necessário para a instalação do recurso selecionado, ele também será instalado. Nota: Desativar não oferece suporte ao parâmetro -All.

PowerShell

Para Windows

Baixe Agora

Recursos