当前位置: 代码迷 >> 综合 >> 利用 PowerShell Script 同时在多台服务器上安装 Roles/Features
  详细解决方案

利用 PowerShell Script 同时在多台服务器上安装 Roles/Features

热度:77   发布时间:2023-12-13 14:19:50.0

1、导出 .XML 配置文件,如 D:\Scripts\DeploymentConfigTemplate.xml

2、使用记事本创建脚本,并执行脚本:

function Invoke-WindowsFeatureBatchDeployment {param ([parameter(mandatory)][string[]] $ComputerNames,[parameter(mandatory)][string] $ConfigurationFilePath)# Deploy the features on multiple computers simultaneously.$jobs = @()foreach($ComputerName in $ComputerNames) {$jobs += Start-Job -Command {Install-WindowsFeature -ConfigurationFilePath $using:ConfigurationFilePath -ComputerName $using:ComputerName -Restart}}Receive-Job -Job $jobs -Wait |
  相关解决方案