fswdnr 发表于 2018-9-2 10:17:44

Powershell DSC 5.0 - 参数,证书加密账号,以及安装顺序

  

  
Configuration LCM_HTTPPULL
  
{
  
    param
  
      (
  
            
  
            ]$ComputerName,
  
            
  
            $guid
  
      )
  
Node $ComputerName
  
{
  
Settings
  
{
  
AllowModuleOverwrite = $True
  
            ConfigurationMode = 'ApplyAndAutoCorrect'
  
RefreshMode = 'Pull'
  
ConfigurationID = $guid
  
            }
  
      ConfigurationRepositoryWeb PullServer {
  
            Name = 'PullServer'
  
            ServerURL = 'http://dc.company.pri:8080/PSDSCPullServer.svc'
  
            AllowUnsecureConnection = $true
  
      }
  
}
  
}
  
# Computer list
  
$ComputerName='s1', 's2'
  
# Create Guid for the computers
  
$guid=::NewGuid()
  
# Create the Computer.Meta.Mof in folder
  
LCM_HTTPPULL -ComputerName $ComputerName -Guid $guid -OutputPath c:\DSC\HTTP
  
# Explorer c:\DSC\HTTP
  
# Send to computers LCM
  
Set-DSCLocalConfigurationManager -ComputerName $computername -Path c:\DSC\HTTP –Verbose


页: [1]
查看完整版本: Powershell DSC 5.0 - 参数,证书加密账号,以及安装顺序