Skip to content

Commit e7ad1b4

Browse files
authored
Merge pull request #14 from xoap-io/dev
feat: multiple changes to template
2 parents 3d5451c + bef61b2 commit e7ad1b4

20 files changed

+115
-422
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
#### Pull Request (PR) description
1414

1515
<!--
16-
Replace this comment block with a description of your PR. Also, make sure you have updated the
17-
CHANGELOG.md, see the task list below. An entry in the CHANGELOG.md is mandatory for all PRs.
16+
Replace this comment block with a description of your PR.
1817
-->
1918

2019
#### This Pull Request (PR) fixes the following issues

.github/workflows/megalinter.yaml

-16
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,3 @@ jobs:
1616
with:
1717
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
1818
fetch-depth: 0
19-
- name: MegaLinter
20-
id: ml
21-
uses: megalinter/megalinter/flavors/[email protected]
22-
env:
23-
VALIDATE_ALL_CODEBASE: true
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
DISABLE: COPYPASTE,SPELL
26-
DISABLE_LINTERS: TERRAFORM_TERRASCAN
27-
- name: Archive production artifacts
28-
if: ${{ success() }} || ${{ failure() }}
29-
uses: actions/upload-artifact@v3
30-
with:
31-
name: MegaLinter reports
32-
path: |
33-
report
34-
mega-linter.log

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/compilerla/conventional-pre-commit
4-
rev: v2.3.0
4+
rev: v2.4.0
55
hooks:
66
- id: conventional-pre-commit
77
stages: [commit-msg]
@@ -30,11 +30,11 @@ repos:
3030
args:
3131
- -b main
3232
- repo: https://github.com/sirosen/check-jsonschema
33-
rev: 0.23.3
33+
rev: 0.27.0
3434
hooks:
3535
- id: check-github-workflows
3636
- repo: https://github.com/pre-commit/mirrors-prettier
37-
rev: v3.0.0
37+
rev: v3.0.3
3838
hooks:
3939
- id: prettier
4040
stages: [commit]

CHANGELOG.md

-30
This file was deleted.

DSCResources/Services/Services.schema.psm1

-53
This file was deleted.

DSCResources/Services/Services.psd1 renamed to DSCResources/XOAP_DSCResource/XOAP_DSCResource.psd1

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#
2-
# Module manifest for module 'Services'
2+
# Module manifest for module 'XOAP_DSCResource'
33
#
4-
# Generated by: Sinisa Sokolic
4+
# Generated by: XOAP.io
55
#
6-
# Generated on: 7/25/2023
6+
# Generated on: 10/11/2023
77
#
88

99
@{
1010

1111
# Script module or binary module file associated with this manifest.
12-
RootModule = 'Services.schema.psm1'
12+
RootModule = 'XOAP_DSCResource.schema.psm1'
1313

1414
# Version number of this module.
1515
ModuleVersion = '0.0.1'
@@ -21,16 +21,16 @@ ModuleVersion = '0.0.1'
2121
GUID = '09a6295a-d863-47d9-b8ac-22fedaf9fcfc'
2222

2323
# Author of this module
24-
Author = 'Sinisa Sokolic'
24+
Author = 'XOAP.io'
2525

2626
# Company or vendor of this module
2727
CompanyName = 'RIS AG'
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2023 XOAP. All rights reserved.'
30+
Copyright = '(c) XOAP.io. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
33-
Description = 'Configure Windows Services for Azure Virtual Desktop VMs based on Windows 11.'
33+
Description = 'Short description of the DSC resource.'
3434

3535
# Minimum version of the Windows PowerShell engine required by this module
3636
PowerShellVersion = '5.1'
@@ -118,7 +118,4 @@ PrivateData = @{
118118

119119
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
120120
# DefaultCommandPrefix = ''
121-
122121
}
123-
124-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
configuration 'XOAP_DSCResource'
2+
{
3+
4+
Import-DSCResource -ModuleName 'XOAPModuleTemplateDSC' -Name 'XOAP_DSCResource' -ModuleVersion '0.0.1'
5+
6+
<#
7+
Registry disableInsecureCipher_a
8+
{
9+
Key = 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\DES 56/56'
10+
ValueName = 'Enabled'
11+
ValueData = '0'
12+
ValueType = 'Dword'
13+
Ensure = 'Present'
14+
Force = $true
15+
}#>
16+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
configuration 'XOAPModuleTemplateDSC'
2+
{
3+
Import-DSCResource -Module 'XOAPModuleTemplateDSC' -Name 'XOAP_DSCResource' -ModuleVersion '0.0.1'
4+
5+
XOAP_DSCResource 'Example'
6+
{
7+
Example [String]= 'Example'
8+
}
9+
}
10+
XOAP_DSCResource -OutputPath 'C:\XOAP_DSCResource'

Examples/Resources/_dummy

Whitespace-only changes.

Examples/XOAPModuleTemplateDSC.ps1

+10-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1-
configuration XOAPModuleTemplateDSC
1+
Configuration 'XOAPModuleTemplateDSC'
22
{
3-
param
4-
(
5-
# Target nodes to apply the configuration
6-
[string[]]$NodeName = 'localhost'
7-
)
3+
Import-DSCResource -Module 'XOAPModuleTemplateDSC' -Name 'XOAP_DSCResource' -ModuleVersion '0.0.1'
84

9-
Import-Module XOAPModuleTemplateDSC
10-
Import-DSCResource -ModuleName XOAPModuleTemplateDSC
5+
param
6+
(
7+
# Target nodes to apply the configuration
8+
[string[]]$NodeName = 'localhost'
9+
)
1110

12-
Node $NodeName
11+
Node 'XOAPModuleTemplateDSC'
1312
{
14-
15-
$moduleRoot = [io.path]::GetDirectoryName((Get-Module XOAPModuleTemplateDSC).Path)
16-
#$examples = "$moduleRoot\Examples"
17-
18-
# Install the IIS role
19-
WindowsFeature IIS
13+
XOAP_DSCResource 'XOAP_DSCResource'
2014
{
21-
Ensure = "Present"
22-
Name = "Web-Server"
2315
}
2416

2517
}
2618
}
27-
19+
XOAPModuleTemplateDSC -OutputPath 'C:\XOAPModuleTemplateDSC'

Readme.md

+37-22
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,54 @@ Please check out common DSC Community [contributing guidelines](https://dsccommu
1212

1313
## Change log
1414

15-
A full list of changes in each version can be found in the [change log](CHANGELOG.md).
15+
A full list of changes in each version can be found in the [Releases](https://github.com/xoap-io/XOAPModuleTemplateDSC/releases).
1616

1717
## Documentation
1818

1919
This script is used to easily create new DSC modules and resources.
2020

2121
## Prerequisites
2222

23-
Please install Plaster first and make sure it's present.
23+
Be sure that the following DSC modules are installed on your system:
2424

25-
```powershell
26-
Install-Module Plaster
27-
Import-Module Plaster
25+
- ModuleName (x.x.x)
26+
27+
## DSC Resources and syntax
28+
29+
### XOAP_AddServerToCollection
30+
31+
```PowerShell
32+
XOAP_DSCResource [String] #ResourceName
33+
{
34+
[DependsOn = [String[]]]
35+
[PsDscRunAsCredential = [PSCredential]]
36+
}
2837
```
2938

30-
## Create new DSC modules
39+
## Configuration examples for each resource
3140

32-
Modules will be automatically created once you are creating a new DSC resource.
41+
You can review the [Examples](/Examples/Resources) directory in the **XOAPModuleTemplateDSC** module
42+
for some general usage scenarios for all the resources that are in the module.
43+
44+
To implement the Module Template DSC module, add the following resources to your DSC configuration and adjust the parameters accordingly:
45+
46+
### Add server to a collection
47+
48+
```PowerShell
49+
configuration 'XOAP_DSCResource'
50+
{
51+
Import-DscResource -ModuleName 'XOAPModuleTemplateDSC' -Name 'XOAP_DSCResource' -ModuleVersion '0.0.1'
52+
53+
XOAP_DSCResource 'Example'
54+
{
55+
DependsOn = @('[String[]]')
56+
PsDscRunAsCredential = [PSCredential]
57+
}
58+
}
59+
XOAP_DSCResource
60+
```
3361

34-
## Create new DSC resources
62+
## Create new DSC resource
3563

3664
DSC resources can easily be deployed via the invocation of
3765

@@ -42,18 +70,5 @@ DSC resources can easily be deployed via the invocation of
4270
with parameters
4371

4472
```powershell
45-
.\New-CompositeResource.ps1 -Module XOAPModuleTemplateDSC -Version 0.0.1 -Resource ScheduledTasks
73+
.\New-CompositeResource.ps1 -Module 'XOAPModuleTemplateDSC' -Version '0.0.1' -Resource 'DSCResource'
4674
```
47-
48-
The parameter list is as followed:
49-
50-
| Parameter | Description | Note |
51-
|-----------|----------------------------------------|------|
52-
| Module | Name of the outer module part | - |
53-
| Version | Target version of the module | - |
54-
| Ressource | The name of the ressource /config part | - |
55-
56-
### Examples
57-
58-
You can review the [Examples](/Examples/Resources) directory in the **XOAPModuleTemplateDSC** module
59-
for some general use scenarios for all the resources that are in the module.

XOAPModuleTemplateDSC.psd1

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#
22
# Module manifest for module 'XOAPAModuleTemplate1DSC'
33
#
4-
# Generated by: Sinisa Sokolic
4+
# Generated by: XOAP.io
55
#
6-
# Generated on: 7/25/2023
6+
# Generated on: 10/10/2023
77
#
88

99
@{
@@ -21,16 +21,16 @@ ModuleVersion = '0.0.1'
2121
GUID = '9300a1eb-8865-4cf3-abf2-bd2f8f7d861d'
2222

2323
# Author of this module
24-
Author = 'Sinisa Sokolic'
24+
Author = 'XOAP.io'
2525

2626
# Company or vendor of this module
2727
CompanyName = 'RIS AG'
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2023 XOAP.io. All rights reserved.'
30+
Copyright = '(c) XOAP.io. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
33-
Description = 'Module to configure Azure Virtual Desktop Optimizations on Windows 11. '
33+
Description = 'Module template for XOAP.io DSC modules.'
3434

3535
# Minimum version of the Windows PowerShell engine required by this module
3636
PowerShellVersion = '5.1'
@@ -118,7 +118,4 @@ PrivateData = @{
118118

119119
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
120120
# DefaultCommandPrefix = ''
121-
122121
}
123-
124-

0 commit comments

Comments
 (0)