-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDSC-For-Windows.ps1
42 lines (34 loc) · 1.1 KB
/
DSC-For-Windows.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Install the required module first. In this case, module for chocolatey download was required and hence it was installed
Install-Module 'cChoco' -Verbose -Force
# Define a configuration and generate the configuration document
Configuration myChocoConfig
{
Import-DscResource -Module cChoco
Node "localhost"
{
LocalConfigurationManager
{
DebugMode = 'ForceModuleImport'
}
cChocoInstaller installChoco
{
InstallDir = "c:\choco"
}
# Specific versions of Prometheus-windows-exporter and filebeat were to be installed using chocolatey
cChocoPackageInstaller installPrometheus
{
Name = "prometheus-windows-exporter.install"
Version = "0.18.1"
DependsOn = "[cChocoInstaller]installChoco"
}
cChocoPackageInstaller installFilebeat
{
Name = "filebeat"
Version = "7.15.1"
DependsOn = "[cChocoInstaller]installChoco"
}
}
}
myChocoConfig
# Statement to apply the configurations to the machine
Start-DscConfiguration .\myChocoConfig -wait -Verbose -force