You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Copy the content from PSModuleTemplate into your new project
27
-
4. Update the README.md and CHANGELOG.md with your information
29
+
4. Update the README.md with your information
28
30
5. Save your function-files in the folder Code
29
31
6. Build your Module with Build-Module.ps1
30
32
@@ -34,7 +36,7 @@ Information about your project.
34
36
35
37
## CHANGELOG
36
38
37
-
Update this file whenever you make changes on your module!
39
+
The Build-Module.ps1 update this file with your last change description.
38
40
39
41
## CI
40
42
@@ -49,6 +51,51 @@ The script also updates the Manifest-File (PSD1) with the functions to export. I
49
51
50
52
Finally Build-Module.ps1 tests if your Module can be imported and removed without any errors. It tests also if the Module contains all of your exported functions.
51
53
54
+
#### Usage
55
+
56
+
Open the Terminal and navigate to the Git-Project. Start the Build-Module.ps1 and enter the answers:
57
+
58
+
````PowerShell
59
+
./CI/Build-Module.ps1
60
+
`````
61
+
62
+
`````text
63
+
[BUILD] [START] Launching Build Process
64
+
Enter the name of the module without the extension: Test-PSModuleTemplate
65
+
Enter the Version number of this module in the Semantic Versioning notation [1.0.0]: 0.0.1
66
+
Enter the Description of the functionality provided by this module: This is a PowerShell-Module to create simple PowerShell-Modules
67
+
Enter the Author of this module: Martin Walther
68
+
Enter the Company or vendor of this module: Martin Walther Foto & IT
69
+
Enter the Prefix for all functions of this module: MWA
70
+
Describe what did you change: Initial upload
71
+
[BUILD] [TEST] Running Function-Tests
72
+
73
+
Starting discovery in 1 files.
74
+
Discovery found 0 tests in 13ms.
75
+
Running tests.
76
+
Tests completed in 13ms
77
+
Tests Passed: 0, Failed: 0, Skipped: 0 NotRun: 0
78
+
79
+
[BUILD] [Code ] Loading Class, public and private functions
80
+
[BUILD] [START] [PSM1] Building Module PSM1
81
+
[BUILD] [END ] [PSM1] building Module PSM1
82
+
[BUILD] [START] [PSD1] Manifest PSD1
83
+
[BUILD] [PSD1 ] Adding functions to export
84
+
[BUILD] [END ] [PSD1] building Manifest
85
+
[BUILD] [END] Launching Build Process
86
+
`````
87
+
88
+
````PowerShell
89
+
Import-Module ./test.psmoduletemplate/
90
+
Get-Command -Module test.psmoduletemplate
91
+
`````
92
+
93
+
`````text
94
+
CommandType Name Version Source
95
+
----------- ---- ------- ------
96
+
Function Get-PRETemplate 0.0.1 test.psmoduletemplate
97
+
`````
98
+
52
99
### Module-Settings.json
53
100
54
101
The settings-file will be created, if you build the module at the first time and contains the following properties:
@@ -58,6 +105,8 @@ The settings-file will be created, if you build the module at the first time and
58
105
ModuleDescription
59
106
ModuleAuthor
60
107
ModuleCompany
108
+
ModulePrefix
109
+
LastChange
61
110
62
111
## Code
63
112
@@ -91,6 +140,30 @@ This folder contains all the Pester-Test-scripts.
91
140
92
141
Functions.Tests.ps1 tests all of your scripts/functions in the folder Code.
93
142
94
-
### Functions.Tests.json
143
+
### Failed.Tests.json
95
144
96
145
This file will be created, if there were some errors in the Build-Module.
146
+
147
+
### Module.Tests.ps1
148
+
149
+
This is the file for your Function-Tests. Here you should write a test for each function to ensure, that your code is not damaged and is valid.
150
+
You can call this Tests in a GitHub-Action or CI/CD-Pipeline or simple manually.
0 commit comments