liukaida 发表于 2018-9-2 09:13:16

Powershell DSC安装Java

configuration Testmsi {  
    Node sydittest {
  
   File MSIFile {
  
            Ensure = "Present"
  
            Type = "Directory“ # Default is “File”
  
            Force = $True
  
            Recurse = $True
  
            SourcePath = '\\sydit01\test2'
  
            DestinationPath = 'C:\Downloads'# On Sydittest
  
      }
  
      Package InstallJava {
  
            Ensure = "Present"
  
            Name='Java 8 Update 71 (64-bit)'
  
            path='c:\downloads\jre1.8.0_71.msi'
  
            productid="26A24AE4-039D-4CA4-87B4-2F86418071F0"
  
            dependson='msifile'
  
      }
  
    }
  
}
  
Testmsi -OutputPath c:\temp\nscpconfig
  
Start-DscConfiguration -computername sydittest -Path c:\temp\nscpConfig -Wait -Verbose -force


页: [1]
查看完整版本: Powershell DSC安装Java