Skip to content

Commit 61e9547

Browse files
committed
Documented CopyMode Project Settings in the readme
1 parent d2e0aa5 commit 61e9547

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Whether you're creating simple or robust modules, ModuleTools streamlines the pr
1515
[![ModuleTools@PowerShell Gallery][BadgeIOCount]][PSGalleryLink]
1616
![WorkFlow Status][WorkFlowStatus]
1717

18-
19-
2018
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.
2119

2220
> [!IMPORTANT]
@@ -28,7 +26,7 @@ The structure of the ModuleTools module is meticulously designed according to Po
2826
Install-Module -Name ModuleTools
2927
```
3028

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.
3230
3331
## 🧵 Design
3432

@@ -70,10 +68,10 @@ Run `New-MTModule` to generate the scaffolding; this will also create the `proje
7068

7169
### Src Folder
7270

73-
- Place all your functions in the `private` and `public` folders within the `src` directory.
74-
- All functions in the `public` folder are exported during the module build.
75-
- All functions in the `private` folder are accessible internally within the module but are not exposed outside the module.
76-
- Contents of the `src/resources` folder, including any subfolder, will included in the `dist` folder during the module build.
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, including any subfolder, will included in the `dist` folder during the module build.
7775

7876
#### resources Folder
7977

@@ -87,11 +85,13 @@ The `resources` folder within the `src` directory is intended for including any
8785

8886
When the module is built, the contents of the `src/resources` folder will be copied directly to the `dist` folder. If the `src/resources` folder contains any subfolders, those subfolders and their contents will also be included in the `dist` folder, ensuring that all necessary files are available for the module to function correctly.
8987

88+
How the resources folder gets copied to the "OutputModuleDir" folder will depends on the "CopyMode" project setting. When missing or set to "Folder", the resources folder will be copied. When "CopyMode" is set to "Content", then only the content of the resources folder will be copied.
89+
9090
Leave `src\resources` empty if there is no need to include any additional content in the `dist` folder.
9191

9292
An example of the module build where resources were included:
9393

94-
```
94+
```powershell
9595
dist
9696
└── TestModule
9797
├── TestModule.psd1
@@ -127,6 +127,11 @@ New-MTModule ~/Work
127127

128128
`ModuleTools` is designed so that you don't need any additional tools like `make` or `psake` to run the build commands. There's no need to maintain complex `build.ps1` files or sample `.psd1` files. Simply follow the structure outlined above, and you can run `Invoke-MTBuild` to build the module. The output will be saved in the `dist` folder, ready for distribution.
129129

130+
The Invoke-MTBuild CmdLet includes a step where the resources folder and/or it's contents are copied to the "OutputModuleDir" folder. This is controlled by the optional "CopyMode" project setting.
131+
132+
If "CopyMode" = 'Folder or if it's missing, the entire resources folder gets copied to the "OutputModuleDir" folder.
133+
If "CopyMode" = 'Content', only the content of the resources folder gets copied to the "OutputModuleDir" folder.
134+
130135
```powershell
131136
# From the Module root
132137
Invoke-MTBuild

0 commit comments

Comments
 (0)