Utilizzare Windows PowerShell per installare funzionalità opzionali

Microsoft Windows viene fornito con una serie di cosiddette funzionalità opzionali che gli utenti possono abilitare o disabilitare utilizzando l'applet del pannello di controllo "attiva o disattiva le funzionalità di Windows".

Funziona bene per la maggior parte, ma richiede di aprire il Pannello di controllo sul sistema operativo a meno che non si carichi direttamente la finestra Funzionalità digitando le funzionalità opzionali in Start.

Sebbene ciò sia sufficiente per la maggior parte del tempo, gli amministratori possono utilizzare anche PowerShell per gestire le funzionalità opzionali del sistema operativo Windows.

La seguente guida fornisce una panoramica su come funziona Windows 10. Notare che ciò potrebbe non funzionare su versioni precedenti di Windows come Windows 7.

Windows PowerShell: installa funzionalità opzionali

È necessario un PowerShell elevato per i seguenti comandi. Toccare il tasto Windows, digitare powershell, tenere premuto il tasto Ctrl e il tasto Maiusc e toccare il tasto Invio per aprire un prompt di PowerShell con privilegi di amministratore.

Elencare tutte le funzionalità opzionali e il loro stato

La prima cosa che potresti voler fare, almeno quando sei nuovo ad usare il comando, è visualizzare l'elenco delle funzionalità disponibili.

Eseguire get-windowsoptionalfeature -online per elencare tutti i nomi delle funzionalità disponibili e i loro stati sul sistema informatico. Lo stato è abilitato o disabilitato.

Nota: il parametro -online indica che le azioni vengono eseguite sul dispositivo corrente.

Sebbene sia abbastanza facile identificare alcune funzionalità in base al nome della funzione, non è facile per tutte.

Il seguente elenco proviene da una versione di Windows 10 Pro 1809

  • FeatureName: Printing-PrintToPDFServices-Features
  • FeatureName: Windows-Defender-Default-Definitions
  • FeatureName: Printing-XPSServices-Features
  • FeatureName: SearchEngine-Client-Package
  • FeatureName: MSRDC-Infrastruttura
  • FeatureName: TelnetClient
  • FeatureName: TFTP
  • FeatureName: TIFFIFilter
  • FeatureName: WorkFolders-Client
  • FeatureName: LegacyComponents
  • FeatureName: DirectPlay
  • FeatureName: Printing-Foundation-Features
  • FeatureName: FaxServicesClientPackage
  • FeatureName: Printing-Foundation-InternetPrinting-Client
  • FeatureName: Printing-Foundation-LPDPrintService
  • FeatureName: Printing-Foundation-LPRPortMonitor
  • FeatureName: SimpleTCP
  • FeatureName: MicrosoftWindowsPowerShellV2Root
  • FeatureName: MicrosoftWindowsPowerShellV2
  • FeatureName: Windows-Identity-Foundation
  • FeatureName: sottosistema Microsoft-Windows-Linux
  • FeatureName: HypervisorPlatform
  • FeatureName: VirtualMachinePlatform
  • FeatureName: Client-ProjFS
  • FeatureName: NetFx4-AdvSrvs
  • FeatureName: 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-WebSocket
  • 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-Trigger
  • FeatureName: MSMQ-ADIntegration
  • FeatureName: MSMQ-HTTP
  • FeatureName: MSMQ-Multicast
  • FeatureName: MSMQ-DCOMProxy
  • FeatureName: WCF-HTTP-Activation
  • FeatureName: WCF-NonHTTP-Activation
  • FeatureName: IIS-CertProvider
  • FeatureName: IIS-WindowsAuthentication
  • FeatureName: IIS-DigestAuthentication
  • FeatureName: IIS-ClientCertificateMappingAuthentication
  • FeatureName: IIS-IISCertificateMappingAuthentication
  • FeatureName: IIS-ODBCLogging
  • FeatureName: NetFx3
  • FeatureName: SMB1Protocol
  • FeatureName: SMB1Protocol-Client
  • FeatureName: SMB1Protocol-Server
  • FeatureName: SMB1Protocol-Deprecation
  • FeatureName: MediaPlayback
  • FeatureName: WindowsMediaPlayer
  • FeatureName: pacchetto Microsoft-Windows-NetFx3-OC
  • FeatureName: pacchetto Microsoft-Windows-NetFx4-US-OC
  • FeatureName: pacchetto Microsoft-Windows-Client-EmbeddedExp
  • FeatureName: pacchetto Microsoft-Windows-NetFx3-WCF-OC
  • FeatureName: pacchetto Microsoft-Windows-NetFx4-WCF-US-OC
  • FeatureName: Containers-DisposableClientVM
  • FeatureName: Microsoft-Hyper-V-All
  • FeatureName: 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-Client
  • 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-Infrastruttura
  • FeatureName: Amministrazione NFS
  • FeatureName: Containers
  • FeatureName: SmbDirect
  • FeatureName: MultiPoint-Connector
  • FeatureName: MultiPoint-Connector-Services
  • FeatureName: MultiPoint-Tools
  • FeatureName: AppServerClient
  • FeatureName: Internet-Explorer-Opzionale-amd64

Visualizza informazioni sulle funzionalità

È possibile utilizzare il parametro -featurename Example per visualizzare informazioni dettagliate su una funzionalità che interessa.

Il comando get-windowsoptionalfeature -online -featurename NetFx 3, ad esempio, rivela che questo installa .Net Framework 3.5 sul sistema. Esiste anche un collegamento Internet a condizione che sia possibile fare clic su per cercare ulteriori informazioni online.

Abilita o disabilita una funzione opzionale

È possibile utilizzare i comandi di PowerShell per abilitare o disabilitare le funzionalità opzionali su un computer Windows 10.

A tale scopo vengono utilizzati i comandi Enable-WindowsOptionalFeature -FeatureName e Disable-WindowsOptionalFeature -FeatureName.

Per darti due esempi per mostrarti come funziona:

  • Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -All - Questo comando installa Net Framework 3.5 sul computer su cui viene eseguito il comando.
  • Disable-WindowsOptionalFeature -Online -FeatureName "NetFx3" - Questo comando disabilita nuovamente la funzione.

Il parametro -All indica a Windows di installare anche eventuali dipendenze. Pertanto, se è richiesta una funzione padre per l'installazione della funzione selezionata, viene installata anche. Nota: Disabilita non supporta il parametro -All.

risorse

  • Technet Microsoft: Enable-WindowsOptionalFeature
  • Technet Microsoft: Disable-WindowsOptionalFeature
  • Technet Microsoft: Get-WindowsOptionalFeature