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]