Skip to content

Commit 9bae233

Browse files
committed
feat: adjusted module template
1 parent f0f7c4a commit 9bae233

File tree

7 files changed

+339
-0
lines changed

7 files changed

+339
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#
2+
# Module manifest for module 'Template'
3+
#
4+
# Generated by: XOAP
5+
#
6+
# Generated on: 12.05.2022
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = 'Template.schema.psm1'
13+
14+
# Version number of this module.
15+
ModuleVersion = '1.0.0'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'e4833b1b-2639-4be2-9e65-7e3d5f4a8ef0'
22+
23+
# Author of this module
24+
Author = 'XOAP'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'XOAP'
28+
29+
# Copyright statement for this module
30+
Copyright = '(c) XOAP.io. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Template'
34+
35+
# Minimum version of the PowerShell engine required by this module
36+
# PowerShellVersion = ''
37+
38+
# Name of the PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
# DotNetFrameworkVersion = ''
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# CLRVersion = ''
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
# RequiredModules = @()
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
# RequiredAssemblies = @()
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
# FormatsToProcess = @()
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
# NestedModules = @()
70+
71+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72+
FunctionsToExport = '*'
73+
74+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
75+
CmdletsToExport = '*'
76+
77+
# Variables to export from this module
78+
VariablesToExport = '*'
79+
80+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
81+
AliasesToExport = '*'
82+
83+
# DSC resources to export from this module
84+
# DscResourcesToExport = @()
85+
86+
# List of all modules packaged with this module
87+
# ModuleList = @()
88+
89+
# List of all files packaged with this module
90+
# FileList = @()
91+
92+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
93+
PrivateData = @{
94+
95+
PSData = @{
96+
97+
# Tags applied to this module. These help with module discovery in online galleries.
98+
Tags = @(DSC, XOAP)
99+
100+
# A URL to the license for this module.
101+
# LicenseUri = ''
102+
103+
# A URL to the main website for this project.
104+
ProjectUri = 'https://xoap.io'
105+
106+
# A URL to an icon representing this module.
107+
# IconUri = ''
108+
109+
# ReleaseNotes of this module
110+
# ReleaseNotes = ''
111+
112+
} # End of PSData hashtable
113+
114+
} # End of PrivateData hashtable
115+
116+
# HelpInfo URI of this module
117+
# HelpInfoURI = ''
118+
119+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
120+
# DefaultCommandPrefix = ''
121+
122+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
configuration Template
2+
{
3+
[CmdletBinding()]
4+
param (
5+
[Parameter()]
6+
[TypeName]
7+
$ParameterName
8+
)
9+
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
10+
11+
#xRegistry disableInsecureCipher_a
12+
#{
13+
# Key = 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\DES 56/56'
14+
# ValueName = 'Enabled'
15+
# ValueData = '0'
16+
# ValueType = 'Dword'
17+
# Ensure = 'Present'
18+
# Force = $true
19+
#}
20+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
configuration Template
2+
{
3+
param
4+
(
5+
# Target nodes to apply the configuration
6+
[string[]]$NodeName = 'localhost'
7+
)
8+
9+
Import-Module XOAPTemplateDSC
10+
Import-DSCResource -ModuleName XOAPTemplateDSC
11+
12+
Node $NodeName
13+
{
14+
$moduleRoot = [io.path]::GetDirectoryName((Get-Module XOAPTemplateDSC).Path)
15+
$examples = "$moduleRoot\Examples"
16+
17+
# Install the IIS role
18+
WindowsFeature IIS
19+
{
20+
Ensure = "Present"
21+
Name = "Web-Server"
22+
}
23+
}
24+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# XOAPTemplateDSC
2+
3+
The XOAPTemplateDSC PowerShell module provides
4+
DSC resources that can be used to ... (explain what functionality the resources are meant to provide)
5+
6+
## Installation
7+
8+
To manually install the module, download the source code and unzip the contents
9+
of the \Modules\XOAPTemplateDSC directory to the
10+
$env:ProgramFiles\WindowsPowerShell\Modules folder
11+
12+
To install from the PowerShell gallery using PowerShellGet (in PowerShell 5.0)
13+
run the following command:
14+
15+
Find-Module -Name XOAPTemplateDSC -Repository PSGallery | Install-Module
16+
17+
To confirm installation, run the below command and ensure you see the
18+
XOAPBaselineW2k19DSC DSC resoures available:
19+
20+
Get-DscResource -Module XOAPTemplate9DSC
21+
22+
## Usage
23+
24+
Include the following in your DSC configuration
25+
26+
Import-DSCResource -ModuleName XOAPTemplateDSC
27+
28+
### MyResource
29+
30+
MyResource resourceName {
31+
Ensure = "Present"
32+
}
33+
34+
## Requirements
35+
36+
The minimum PowerShell version required is 4.0, which ships in Windows 8.1
37+
or Windows Server 2012R2 (or higher versions). The preferred version is
38+
PowerShell 5.0 or higher, which ships with Windows 10 or Windows Server 2016.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#
2+
# Module manifest for module 'XOAPTemplateDSC'
3+
#
4+
# Generated by: XOAP
5+
#
6+
# Generated on: 12.05.2022
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
# RootModule = ''
13+
14+
# Version number of this module.
15+
ModuleVersion = '0.0.1'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'e4951f8b-227a-48d7-ab40-fb76f8a2378f'
22+
23+
# Author of this module
24+
Author = 'XOAP'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'XOAP'
28+
29+
# Copyright statement for this module
30+
Copyright = '(c) XOAP.io. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'XOAPTemplateDSC'
34+
35+
# Minimum version of the PowerShell engine required by this module
36+
# PowerShellVersion = ''
37+
38+
# Name of the PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
# DotNetFrameworkVersion = ''
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# CLRVersion = ''
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
# RequiredModules = @()
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
# RequiredAssemblies = @()
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
# FormatsToProcess = @()
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
# NestedModules = @()
70+
71+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72+
FunctionsToExport = @()
73+
74+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
75+
CmdletsToExport = @()
76+
77+
# Variables to export from this module
78+
VariablesToExport = '*'
79+
80+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
81+
AliasesToExport = @()
82+
83+
# DSC resources to export from this module
84+
# DscResourcesToExport = @()
85+
86+
# List of all modules packaged with this module
87+
# ModuleList = @()
88+
89+
# List of all files packaged with this module
90+
# FileList = @()
91+
92+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
93+
PrivateData = @{
94+
95+
PSData = @{
96+
97+
# Tags applied to this module. These help with module discovery in online galleries.
98+
Tags = @(DSC, XOAP)
99+
100+
# A URL to the license for this module.
101+
# LicenseUri = ''
102+
103+
# A URL to the main website for this project.
104+
ProjectUri = 'https://xoap.io'
105+
106+
# A URL to an icon representing this module.
107+
# IconUri = ''
108+
109+
# ReleaseNotes of this module
110+
# ReleaseNotes = ''
111+
112+
} # End of PSData hashtable
113+
114+
} # End of PrivateData hashtable
115+
116+
# HelpInfo URI of this module
117+
# HelpInfoURI = ''
118+
119+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
120+
# DefaultCommandPrefix = ''
121+
122+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
describe 'When setting up a webserver' {
2+
context 'to start the default website' {
3+
4+
it 'verifies IIS is installed' {
5+
(Get-WindowsFeature web-server).installed | should be $true
6+
}
7+
8+
it 'installs a default website' {
9+
Get-Website 'Default Web Site' | should not be $null
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)