Użyj programu Windows PowerShell, aby zainstalować opcjonalne funkcje
- Kategoria: Windows
Microsoft Windows jest dostarczany z zestawem tak zwanych opcjonalnych funkcji, które użytkownicy mogą włączać lub wyłączać za pomocą apletu panelu sterowania „włączanie lub wyłączanie funkcji systemu Windows”.
W większości działa to dobrze, ale wymaga tego od Ciebie otwórz Panel sterowania w systemie operacyjnym, chyba że załadujesz okno Funkcje bezpośrednio, wpisując optionalfeatures w Start .
Chociaż jest to wystarczające przez większość czasu, administratorzy mogą również używać programu PowerShell do zarządzania opcjonalnymi funkcjami systemu operacyjnego Windows.
Poniższy przewodnik zawiera przegląd tego, jak to działa w systemie Windows 10. Należy pamiętać, że może to nie działać w poprzednich wersjach systemu Windows, takich jak Windows 7.
Windows PowerShell: zainstaluj opcjonalne funkcje
Potrzebujesz podwyższony PowerShell dla następujących poleceń. Naciśnij klawisz Windows, wpisz powershell, przytrzymaj klawisz Ctrl i klawisz Shift, a następnie naciśnij klawisz Enter, aby otworzyć monit PowerShell z uprawnieniami administratora.
Wymień wszystkie opcjonalne funkcje i ich stan
Pierwszą rzeczą, którą możesz chcieć zrobić, przynajmniej gdy jesteś nowy w korzystaniu z polecenia, jest wyświetlenie listy dostępnych funkcji.
Biegać get-windowsoptionalfeature -online aby wyświetlić wszystkie dostępne nazwy funkcji i ich stany w systemie komputerowym. Stan jest włączony lub wyłączony.
Uwaga: parametr -online oznacza, że akcje są wykonywane na bieżącym urządzeniu.
Chociaż dość łatwo jest zidentyfikować niektóre funkcje według nazwy, nie jest to łatwe dla wszystkich.
Poniższa lista pochodzi z systemu Windows 10 Pro w wersji 1809
- FeatureName: Printing-PrintToPDFServices-Features
- FeatureName: Windows-Defender-Default-Definitions
- FeatureName: Printing-XPSServices-Features
- FeatureName: SearchEngine-Client-Package
- FeatureName: infrastruktura MSRDC
- FeatureName: TelnetClient
- FeatureName: TFTP
- FeatureName: TIFFIFilter
- FeatureName: WorkFolders-Client
- FeatureName: LegacyComponents
- FeatureName: DirectPlay
- FeatureName: Drukowanie-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: Microsoft-Windows-Subsystem-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: wydajność usług IIS
- 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: Zgodność z usługami IIS-WMIC
- 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: kontener MSMQ
- FeatureName: MSMQ-Server
- FeatureName: wyzwalacze MSMQ
- FeatureName: MSMQ-ADIntegration
- FeatureName: MSMQ-HTTP
- FeatureName: MSMQ-Multicast
- FeatureName: MSMQ-DCOMProxy
- FeatureName: aktywacja WCF-HTTP
- FeatureName: aktywacja WCF-NonHTTP
- FeatureName: IIS-CertProvider
- FeatureName: IIS-WindowsAuthentication
- FeatureName: IIS-DigestAuthentication
- FeatureName: IIS-ClientCertificateMappingAuthentication
- FeatureName: US-IISCertificateMappingAuthentication
- FeatureName: IIS-ODBCLogging
- FeatureName: NetFx3
- FeatureName: SMB1Protocol
- FeatureName: SMB1Protocol-Client
- FeatureName: SMB1Protocol-Server
- FeatureName: SMB1Protocol-Deprecation
- FeatureName: MediaPlayback
- FeatureName: WindowsMediaPlayer
- FeatureName: Microsoft-Windows-NetFx3-OC-Package
- FeatureName: Pakiet Microsoft-Windows-NetFx4-US-OC
- FeatureName: Microsoft-Windows-Client-EmbeddedExp-Package
- FeatureName: pakiet Microsoft-Windows-NetFx3-WCF-OC
- FeatureName: pakiet 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-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: Administracja NFS
- FeatureName: kontenery
- FeatureName: SmbDirect
- FeatureName: złącze wielopunktowe
- FeatureName: MultiPoint-Connector-Services
- FeatureName: narzędzia MultiPoint
- FeatureName: AppServerClient
- FeatureName: Internet-Explorer-Optional-amd64
Wyświetl informacje o funkcjach
Możesz użyć parametru -featurename Example, aby wyświetlić szczegółowe informacje o interesującej Cię funkcji.
Komenda get-windowsoptionalfeature -online -featurename NetFx Na przykład 3 ujawnia, że powoduje to zainstalowanie .Net Framework 3.5 w systemie. Istnieje również łącze internetowe, pod warunkiem że można kliknąć, aby wyszukać dodatkowe informacje w Internecie.
Włącz lub wyłącz opcjonalną funkcję
Możesz użyć poleceń programu PowerShell, aby włączyć lub wyłączyć opcjonalne funkcje na komputerze z systemem Windows 10.
Do tego celu służą polecenia Enable-WindowsOptionalFeature -FeatureName i Disable-WindowsOptionalFeature -FeatureName.
Aby podać dwa przykłady, aby pokazać, jak to działa:
- Enable-WindowsOptionalFeature -Online -FeatureName 'NetFx3' -Wszystkie - To polecenie instaluje Net Framework 3.5 na komputerze, na którym jest uruchamiane.
- Wyłącz-WindowsOptionalFeature -Online -FeatureName 'NetFx3' - To polecenie ponownie wyłącza tę funkcję.
Parametr -All nakazuje systemowi Windows zainstalowanie również wszelkich zależności. Jeśli więc do instalacji wybranej funkcji wymagana jest funkcja nadrzędna, jest ona również instalowana. Uwaga: Disable nie obsługuje parametru -All.

PowerShell
Dla Windowsa
Pobierz terazZasoby
- Microsoft Technet: Enable-WindowsOptionalFeature
- Microsoft Technet: Wyłącz-WindowsOptionalFeature
- Microsoft Technet: Get-WindowsOptionalFeature