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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,15 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
-
## Inprogress
5
+
## [1.0.0] - 2025-03-11
6
6
7
-
- Updated `ProjecUri` typo to `ProjectUri` in all places. This should work properly for all new module invokes.
7
+
### Added
8
+
9
+
- New optional project setting `copyResourcesToModuleRoot`. Setting to true places resource files in the root directory of module. Default is `false` to provide backward compatibility. Thanks to @[BrooksV](https://github.com/BrooksV)
The structure of the ModuleTools module is meticulously designed according to PowerShell best practices for module development. While some design decisions may seem unconventional, they are made to ensure that ModuleTools and the process of building modules remain straightforward and easy to manage.
21
19
22
20
> [!IMPORTANT]
@@ -28,7 +26,7 @@ The structure of the ModuleTools module is meticulously designed according to Po
28
26
Install-Module -Name ModuleTools
29
27
```
30
28
31
-
> Note: ModuleTolls is still in early devleopment phase and lot of changes are expected. Please read through [ChangeLog](/CHANGELOG.md) for all updates.
29
+
> Note: ModuleTolls is still in early development phase and lot of changes are expected. Please read through [ChangeLog](/CHANGELOG.md) for all updates.
32
30
33
31
## 🧵 Design
34
32
@@ -62,8 +60,6 @@ Generated module is stored in dist folder, you can easily import it or publish i
62
60
└── TestModule.psm1
63
61
```
64
62
65
-
66
-
67
63
### Project JSON File
68
64
69
65
The `project.json` file contains all the important details about your module and is used during the module build. It should comply with a specific schema. You can refer to the sample `project-sample.json` file in the `example` directory for guidance.
@@ -72,9 +68,42 @@ Run `New-MTModule` to generate the scaffolding; this will also create the `proje
72
68
73
69
### Src Folder
74
70
75
-
- Place all your functions in the `private` and `public` folders within the `src` directory.
76
-
- All functions in the `public` folder are exported during the module build.
77
-
- All functions in the `private` folder are accessible internally within the module but are not exposed outside the module.
71
+
- Place all your functions in the `private` and `public` folders within the `src` directory.
72
+
- All functions in the `public` folder are exported during the module build.
73
+
- All functions in the `private` folder are accessible internally within the module but are not exposed outside the module.
74
+
- Contents of the `src/resources` folder will be handled based on setting `copyResourcesToModuleRoot`
75
+
76
+
#### Resources Folder
77
+
78
+
The `resources` folder within the `src` directory is intended for including any additional resources required by your module. This can include files such as:
79
+
80
+
-**Configuration files**: Store any JSON, XML, or other configuration files needed by your module.
81
+
-**Script files**: Place any scripts that are used by your functions or modules, but are not directly part of the public or private functions.
82
+
-**Documentation files**: Include any supplementary documentation that supports the usage or development of the module.
83
+
-**Data files**: Store any data files that are used by your module, such as CSV or JSON files.
84
+
-**Subfolder**: Include any additional folders and their content to be included with the module, such as dependant Modules, APIs, DLLs, etc... organized by a subfolder.
85
+
86
+
87
+
By default, resource files from `src/resources` go into `dist/resources`. To place them directly in dist (avoiding the resources subfolder), set `copyResourcesToModuleRoot` to `true`. This provides greater control in certain deployment scenarios where resources files are preferred in module root directory.
88
+
89
+
Leave `src\resources` empty if there is no need to include any additional content in the `dist` folder.
90
+
91
+
An example of the module build where resources were included and `copyResourcesToModuleRoot` is set to true.
92
+
93
+
```powershell
94
+
dist
95
+
└── TestModule
96
+
├── TestModule.psd1
97
+
├── TestModule.psm1
98
+
├── config.json
99
+
├── additionalScript.ps1
100
+
├── helpDocumentation.md
101
+
├── sampleData.csv
102
+
└── subfolder
103
+
├── subConfig.json
104
+
├── subScript.ps1
105
+
└── subData.csv
106
+
```
78
107
79
108
### Tests Folder
80
109
@@ -126,7 +155,15 @@ A simple command to update the module version by modifying the values in `projec
126
155
127
156
## Advanced - Use it in Github Actions
128
157
129
-
This is not required for local module builds, if you are running github actions, use below template to test, build and publish module with ease.
158
+
This is not required for local module builds, if you are running github actions, use the following yaml workflow template to test, build and publish module which helps to automate the process of:
159
+
160
+
1. Checking out the repository code.
161
+
1. Installing the `ModuleTools` module from the PowerShell Gallery.
162
+
1. Building the module.
163
+
1. Running Pester tests.
164
+
1. Publishing the module to a specified repository.
165
+
166
+
This allows for seamless and automated management of your PowerShell module, ensuring consistency and reliability in your build, test, and release processes.
Copy file name to clipboardExpand all lines: project.json
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
{
2
2
"ProjectName": "ModuleTools",
3
3
"Description": "ModuleTools is a versatile, standalone PowerShell module builder. Create anything from simple to robust modules with ease. Built for CICD and Automation.",
0 commit comments