|
7 | 7 | .DESCRIPTION
|
8 | 8 | This function takes a template and turns it into a finished file&folder structure.
|
9 | 9 | It does so by creating the files and folders stored within, replacing all parameters specified with values provided by the user.
|
10 |
| - |
| 10 | + |
11 | 11 | Missing parameters will be prompted for.
|
12 | 12 |
|
13 | 13 | .PARAMETER Template
|
|
38 | 38 | Skip automatic folder creation for project templates.
|
39 | 39 | By default, this command will create a folder to place files&folders in when creating a project.
|
40 | 40 |
|
41 |
| - .PARAMETER Force |
42 |
| - If the target path the template should be written to (filename or folder name within $OutPath), then overwrite it. |
43 |
| - By default, this function will fail if an overwrite is required. |
| 41 | + .PARAMETER Parameters |
| 42 | + A Hashtable containing parameters for use in creating the template. |
44 | 43 |
|
45 | 44 | .PARAMETER Raw
|
46 | 45 | By default, all parameters will be replaced during invocation.
|
47 | 46 | In Raw mode, this is skipped, reproducing mostly the original template input (dynamic scriptblocks will now be named scriptblocks)).
|
48 | 47 |
|
| 48 | + .PARAMETER Force |
| 49 | + If the target path the template should be written to (filename or folder name within $OutPath), then overwrite it. |
| 50 | + By default, this function will fail if an overwrite is required. |
| 51 | + |
49 | 52 | .PARAMETER Silent
|
50 | 53 | This places the function in unattended mode, causing it to error on anything requiring direct user input.
|
51 | 54 |
|
52 | 55 | .PARAMETER EnableException
|
53 |
| - Replaces user friendly yellow warnings with bloody red exceptions of doom! |
54 |
| - Use this if you want the function to throw terminating errors you want to catch. |
| 56 | + Replaces user friendly yellow warnings with bloody red exceptions of doom! |
| 57 | + Use this if you want the function to throw terminating errors you want to catch. |
55 | 58 |
|
56 | 59 | .EXAMPLE
|
57 | 60 | PS C:\> Invoke-PSMDTemplate -TemplateName "module"
|
58 |
| - |
| 61 | + |
59 | 62 | Creates a project based on the module template in the current folder, asking for all details.
|
60 | 63 |
|
61 | 64 | .EXAMPLE
|
62 | 65 | PS C:\> Invoke-PSMDTemplate -TemplateName "module" -Name "MyModule"
|
63 |
| - |
| 66 | + |
64 | 67 | Creates a project based on the module template with the name "MyModule"
|
65 | 68 | #>
|
66 | 69 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
|
|
158 | 161 | #region Helper function
|
159 | 162 | function Invoke-Template
|
160 | 163 | {
|
| 164 | + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] |
161 | 165 | [CmdletBinding()]
|
162 | 166 | param (
|
163 | 167 | [PSModuleDevelopment.Template.TemplateInfo]
|
|
308 | 312 |
|
309 | 313 | function Write-TemplateItem
|
310 | 314 | {
|
| 315 | + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] |
311 | 316 | [CmdletBinding()]
|
312 | 317 | param (
|
313 | 318 | [PSModuleDevelopment.Template.TemplateItemBase]
|
|
0 commit comments