如何在Windows中通过PowerShell管理Windows的可选功能

image

Most people know that you can enable or disable the optional Windows features through the Control Panel, but today we’re going to show you how you can do the same thing through the PowerShell command line in Windows 8.

大多数人都知道可以通过“控制面板”启用或禁用可选的Windows功能,但是今天我们将向您展示如何通过Windows 8中的PowerShell命令行执行相同的操作。

从PowerShell管理Windows可选功能 (Manage Windows Optional Features From PowerShell)

The first thing you will want to do is see what features you have enabled, to do this we will need to pass the output of the Get-WindowsOptionalFeature cmdlet down the pipeline, where it can be filtered and formatted:

您要做的第一件事是查看已启用的功能,为此,我们需要将Get-WindowsOptionalFeature cmdlet的输出传递到管道中,在此可以对其进行过滤和格式化:

Get-WindowsOptionalFeature –Online | Where-Object {$_.State –eq “Enabled”} | Format-Table

Get-WindowsOptionalFeature –在线| 哪里对象{$ _。State -eq“ Enabled”} | 格式表

image

That will give you a nice tabulated view of what is enabled.

这将为您提供启用状态的漂亮列表视图。

image

If you want to see what features are disabled you can use the following:

如果要查看禁用了哪些功能,可以使用以下命令:

Get-WindowsOptionalFeature –Online | Where-Object {$_.State –eq “Disabled”} | Format-Table

Get-WindowsOptionalFeature –在线| 哪里的对象{$ _。State –eq“已禁用”} | 格式表

image

If you need to disable a feature you can use the following:

如果需要禁用功能,可以使用以下功能:

Disable-WindowsOptionalFeature –FeatureName NetFx3 –Online

Disable-WindowsOptionalFeature –功能名称NetFx3 –在线

This assumes that the feature that you want to disable is NetFx3.

这假定您要禁用的功能是NetFx3。

image

Of course, you will most likely be adding a feature which can be done like so:

当然,您很可能会添加可以通过以下方式完成的功能:

Enable-WindowsOptionalFeature –FeatureName NetFx3 –Online

Enable-WindowsOptionalFeature –功能名称NetFx3 –在线

image

That’s all there is to it.

这里的所有都是它的。

翻译自: https://www.howtogeek.com/119059/stupid-geek-tricks-manage-windows-optional-features-from-powershell-in-windows-8/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值