神剑山庄资源网 Design By www.hcban.com

在Windows Server 2012中使用PowerShell添加和删除Windows角色和功能非常方便,但是在windows 8.1上启用和禁用Windows选项却略显鸡肋。

比如Get-WindowsOptionalFeature获取当前所有的Windows功能选项:
复制代码 代码如下:
PS> Get-WindowsOptionalFeature -Online | select * -First 1


FeatureName      : Microsoft-Hyper-V-All
State            : Enabled
Path             :
Online           : True
WinPath          :
SysDrivePath     :
RestartNeeded    : False
LogPath          : I:\Windows\Logs\DISM\dism.log
ScratchDirectory :
LogLevel         : WarningsInfo

Microsoft-Hyper-V-All到底是什么?是不是下图中的Windows功能对话框中的Hyper-V,还是Hyper-V管理平台。如果能有一个英文的FeatureName和下图中本地化名称对应就好了。

PowerShell查看Windows功能选项的方法

PowerShell获取Windows功能选项

幸好WMI中的Win32_OptionalFeature可以做到这一点:

复制代码 代码如下:
Get-WmiObject -Class Win32_OptionalFeature |
 Select Name,Caption |
ConvertTo-Html

输出结果为:

Name Caption Microsoft-Hyper-V-All Hyper-V Microsoft-Hyper-V-Tools-All Hyper-V 管理工具 Microsoft-Hyper-V Hyper-V 平台 Microsoft-Hyper-V-Management-Clients Hyper-V GUI 管理工具 Microsoft-Hyper-V-Management-PowerShell Windows PowerShell 的 Hyper-V 模块 Printing-Foundation-Features 打印和文件服务 Printing-Foundation-LPRPortMonitor LPR 端口监视器 Printing-Foundation-LPDPrintService LPD 打印服务 Printing-Foundation-InternetPrinting-Client Internet 打印客户端 FaxServicesClientPackage Windows 传真和扫描 ScanManagementConsole 扫描管理 LegacyComponents 旧版组件 DirectPlay DirectPlay SimpleTCP 简单 TCPIP 服务(即 echo、daytime 等) SNMP 简单网络管理协议(SNMP) WMISnmpProvider WMI SNMP 提供程序 Windows-Defender-Default-Definitions Windows-Identity-Foundation Windows Identity Foundation 3.5 MicrosoftWindowsPowerShellV2Root Windows PowerShell 2.0 MicrosoftWindowsPowerShellV2 Windows PowerShell 2.0 Engine DirectoryServices-ADAM-Client Active Directory 轻型目录服务 Internet-Explorer-Optional-amd64 Internet Explorer 11 NetFx3 .NET Framework 3.5 (包括 .NET 2.0 和 3.0) IIS-WebServerRole Internet Information Services IIS-WebServer 万维网服务 IIS-CommonHttpFeatures 常见 HTTP 功能 IIS-HttpErrors HTTP 错误 IIS-HttpRedirect HTTP 重定向 IIS-ApplicationDevelopment 应用程序开发功能 IIS-NetFxExtensibility .NET Extensibility 3.5 IIS-NetFxExtensibility45 .NET Extensibility 4.5 IIS-HealthAndDiagnostics 运行状况和诊断 IIS-HttpLogging HTTP 日志 IIS-LoggingLibraries 日志工具 IIS-RequestMonitor 请求监视器 IIS-HttpTracing 跟踪 IIS-Security 安全性 IIS-URLAuthorization URL 授权 IIS-RequestFiltering 请求筛选 IIS-IPSecurity IP 安全 IIS-Performance 性能功能 IIS-HttpCompressionDynamic 动态内容压缩 IIS-WebServerManagementTools Web 管理工具 IIS-ManagementScriptingTools IIS 管理脚本和工具 IIS-IIS6ManagementCompatibility IIS 6 管理兼容性 IIS-Metabase IIS 元数据库和 IIS 6 配置兼容性 WAS-WindowsActivationService Windows Process Activation Service WAS-ProcessModel 进程模型 WAS-NetFxEnvironment .NET 环境 WAS-ConfigurationAPI 配置 API IIS-HostableWebCore Internet Information Services 可承载的 Web 核心 IIS-CertProvider 集中式 SSL 证书支持 IIS-WindowsAuthentication Windows 身份验证 IIS-DigestAuthentication 摘要式身份验证 IIS-ClientCertificateMappingAuthentication 客户端证书映射身份验证 IIS-IISCertificateMappingAuthentication IIS 客户端证书映射身份验证 IIS-ODBCLogging ODBC 日志记录 IIS-StaticContent 静态内容 IIS-DefaultDocument 默认文档 IIS-DirectoryBrowsing 目录浏览 IIS-WebDAV WebDAV 发布 IIS-WebSockets WebSocket 协议 IIS-ApplicationInit 应用程序初始化 IIS-ASPNET ASP.NET 3.5 IIS-ASPNET45 ASP.NET 4.5 IIS-ASP ASP IIS-CGI CGI IIS-ISAPIExtensions ISAPI 扩展 IIS-ISAPIFilter ISAPI 筛选器 IIS-ServerSideIncludes 服务器端包含 IIS-CustomLogging 自定义日志 IIS-BasicAuthentication 基本身份验证 IIS-HttpCompressionStatic 静态内容压缩 IIS-ManagementConsole IIS 管理控制台 IIS-ManagementService IIS 管理服务 IIS-WMICompatibility IIS 6 WMI 兼容性 IIS-LegacyScripts IIS 6 脚本工具 IIS-LegacySnapIn IIS 6 管理控制台 IIS-FTPServer FTP 服务器 IIS-FTPSvc FTP 服务 IIS-FTPExtensibility FTP 扩展性 MSMQ-Container Microsoft Message Queue (MSMQ) 服务器 MSMQ-Server Microsoft Message Queue (MSMQ) 服务器核心 MSMQ-Triggers MSMQ 触发器 MSMQ-ADIntegration MSMQ Active Directory 域服务集成 MSMQ-HTTP MSMQ HTTP 支持 MSMQ-Multicast 多播支持 MSMQ-DCOMProxy MSMQ DCOM 代理 WCF-Services45 WCF 服务 WCF-HTTP-Activation45 HTTP 激活 WCF-TCP-Activation45 TCP 激活 WCF-Pipe-Activation45 命名管道激活 WCF-MSMQ-Activation45 消息队列(MSMQ)激活 WCF-TCP-PortSharing45 TCP 端口共享 WCF-HTTP-Activation Windows Communication Foundation HTTP 激活 WCF-NonHTTP-Activation Windows Communication Foundation 非 HTTP 激活 NetFx4-AdvSrvs .NET Framework 4.5 高级服务 NetFx4Extended-ASPNET45 ASP.NET 4.5 MediaPlayback 媒体功能 WindowsMediaPlayer Windows Media Player Microsoft-Windows-MobilePC-Client-Premium-Package-net 网络投影 Microsoft-Windows-MobilePC-LocationProvider-INF Windows 定位程序 Printing-XPSServices-Features XPS 服务 RasCMAK RAS 连接管理器管理工具包(CMAK) RasRip RIP 侦听器 MSRDC-Infrastructure 远程差分压缩 API 支持 SearchEngine-Client-Package Windows Search TelnetClient Telnet 客户端 TelnetServer Telnet 服务器 TFTP TFTP 客户端 TIFFIFilter Windows TIFF IFilter Xps-Foundation-Xps-Viewer XPS 查看器 WorkFolders-Client 工作文件夹客户端 SMB1Protocol SMB 1.0/CIFS 文件共享支持
标签:
PowerShell,Windows,功能选项

神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网 免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com

评论“PowerShell查看Windows功能选项的方法”

暂无PowerShell查看Windows功能选项的方法的评论...