PowerShell 技能连载 - 安装 Windows 功能

在服务器中,Powershell 可以通过 Install-WindowsFeature 命令安装 Windows 功能。

若您将 Install-WindowsFeature 返回的结果保存下来,则可以用 Get-WindowsFeature 查看安装的状态:

# install features on server and save result in $result
Install-WindowsFeature -Name AD-Domain-Services, DNS -IncludeManagementTools -OutVariable result -Verbose

# view the result of your change
Get-WindowsFeature -Name $result.FeatureResult.Name

本文国际来源:Installing Windows Features

评论