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
🩹 [Patch]: Allow more overrides from manifest.psd1 + smarter defaults (#95)
## Description
This pull request includes updates to the `Build-PSModuleManifest`
function in the `scripts/helpers/Build/Build-PSModuleManifest.ps1` file.
The changes aim to improve the handling of manifest properties by
preserving existing values when they are present.
Key changes include:
* **Handling of `RequiredAssemblies`:**
- Added logic to preserve existing `RequiredAssemblies` values if they
are present, otherwise populate with new values or set to an empty array
if none are found. Now also includes `*.dll` files under the `modules`
folder of the built module (non recursive).
* **Handling of `NestedModules`:**
- Added logic to preserve existing `NestedModules` values if they are
present, otherwise populate with new values or set to an empty array if
none are found. Now also includes *.dll files under the `modules` folder
of the built module. Will only look on one level down, not recursively
within each subfolder.
* **Handling of `ScriptsToProcess`:**
- Added logic to preserve existing `ScriptsToProcess` values if they are
present, otherwise populate with new values or set to an empty array if
none are found.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]
## Checklist
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,8 +79,8 @@ During the module manifest build process the following steps are performed:
79
79
1. Set the `Description` based on the GitHub repository description. If a value exists in the source manifest file, this value is used.
80
80
1. Set various properties in the manifest such as `PowerShellHostName`, `PowerShellHostVersion`, `DotNetFrameworkVersion`, `ClrVersion`, and `ProcessorArchitecture`. There is currently no automation for these properties. If a value exists in the source manifest file, this value is used.
81
81
1. Get the list of files in the module source folder and set the `FileList` property in the manifest.
82
-
1. Get the list of required assemblies (`*.dll` files) from the `assemblies` folder and set the `RequiredAssemblies` property in the manifest.
83
-
1. Get the list of nested modules (`*.psm1`files) from the `modules` folder and set the `NestedModules` property in the manifest.
82
+
1. Get the list of required assemblies (`*.dll` files) from the `assemblies`and `modules` (depth = 1) folder and set the `RequiredAssemblies` property in the manifest.
83
+
1. Get the list of nested modules (`*.psm1`, `*.ps1` and `*.dll`files one level down) from the `modules` folder and set the `NestedModules` property in the manifest.
84
84
1. Get the list of scripts to process (`*.ps1` files) from the `scripts` folders and set the `ScriptsToProcess` property in the manifest. This ensures that the scripts are loaded to the caller session (parent of module session).
85
85
1. Get the list of types to process by searching for `*.Types.ps1xml` files in the entire module source folder and set the `TypesToProcess` property in the manifest.
86
86
1. Get the list of formats to process by searching for `*.Format.ps1xml` files in the entire module source folder and set the `FormatsToProcess` property in the manifest.
@@ -120,11 +120,11 @@ Linking the description to the module manifest file might show more how this wor
120
120
ClrVersion = '' # Get from manifest file, null if not provided.
121
121
ProcessorArchitecture = '' # Get from manifest file, null if not provided.
122
122
RequiredModules = @() # Get from source files, REQUIRES -Modules <Module-Name> | <Hashtable> -> Need to be installed and loaded on build time. Will be installed in global session state during installtion.
123
-
RequiredAssemblies = @() # Get from assemblies\*.dll.
123
+
RequiredAssemblies = @() # Get from assemblies\*.dll + modules\*.dll.
124
124
ScriptsToProcess = @() # Get from scripts\*.ps1 and classes\*.ps1 ordered by name. These are loaded to the caller session (parent of module session).
125
125
TypesToProcess = @() # Get from *.Types.ps1xml anywhere in the source module folder.
126
126
FormatsToProcess = @() # Get from *.Format.ps1xml anywhere in the source module folder.
127
-
NestedModules = @() # Get from modules\*.psm1.
127
+
NestedModules = @() # Get from modules\*.psm1 + modules\*.ps1 + modules\*.dll.
128
128
FunctionsToExport = @() # Get from public\*.ps1.
129
129
CmdletsToExport = @() # Get from manifest file, @() if not provided.
130
130
VariablesToExport = @() # Get from variables\public\*.ps1.
0 commit comments