#------添加角色/角色服务------ Import-Module servermanager $features = get-windowsfeature Net-*,Telnet-*,Web-* Write-Host " 开始添加角色/角色服务... ..." foreach($item in $features) { if($item.installed -eq $false) { Write-Host "添加:" $item.DisplayName $item | add-windowsfeature } }