Skip to content

Commit daf46ab

Browse files
author
tester bester
committed
dsc
1 parent 87064d0 commit daf46ab

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/DSC-based.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "2025 desktop DSC packages CI workflow"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
schedule:
7+
- cron: '39 11 * * *'
8+
9+
jobs:
10+
windows-2025-pwsh-dsc:
11+
name: "2025 DSC packages"
12+
runs-on: windows-2025
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v1
16+
17+
- name: "Apply DSC Configuration"
18+
run: |
19+
# Import the DSC resources if they are not already available
20+
Install-Module -Name PSDscResources, cChoco -Force
21+
22+
# Run the DSC configuration to generate the MOF file
23+
.\scripts\DesktopPackages.ps1
24+
25+
# Apply the DSC configuration
26+
Start-DscConfiguration -Path .\DesktopPackages -Wait -Verbose
27+
shell: pwsh
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Configuration DesktopPackages {
2+
# Import the necessary DSC resources
3+
Import-DscResource -ModuleName 'PSDscResources'
4+
Import-DscResource -ModuleName 'cChoco'
5+
6+
# Define a node for the local machine
7+
Node 'localhost' {
8+
# A resource to ensure Chocolatey is installed
9+
cChocoInstaller InstallChocolatey {
10+
Ensure = 'Present'
11+
}
12+
13+
# A resource to install multiple packages using cChoco
14+
cChocoPackageInstallerSet InstallTools {
15+
DependsOn = '[cChocoInstaller]InstallChocolatey'
16+
Name = @('sysinternals', 'git', 'notepadplusplus', '7zip')
17+
Ensure = 'Present'
18+
}
19+
20+
# Another resource for a different set of packages
21+
cChocoPackageInstallerSet InstallBrowsers {
22+
DependsOn = '[cChocoInstaller]InstallChocolatey'
23+
Name = @('googlechrome', 'firefox')
24+
Ensure = 'Present'
25+
}
26+
27+
# Example of installing an MSI package directly
28+
# You would need to provide the path to the MSI and the ProductId
29+
# Package LibreOffice {
30+
# Name = 'libreoffice'
31+
# Path = 'C:\path\to\libreoffice.msi'
32+
# ProductId = 'PRODUCT-ID-GUID'
33+
# Ensure = 'Present'
34+
# }
35+
}
36+
}

0 commit comments

Comments
 (0)