|
| 1 | +{ |
| 2 | + "$schema": "https://raw.githubusercontent.com/PowerShell/Plaster/v2/schema/plaster-manifest-v2.json", |
| 3 | + "schemaVersion": "2.0", |
| 4 | + "metadata": { |
| 5 | + "id": "dcd95744-8abc-4ecb-a439-bf2cd37821bb", |
| 6 | + "name": "NewModule", |
| 7 | + "title": "New Module", |
| 8 | + "description": "Scaffolds the files required for a PowerShell module.", |
| 9 | + "version": "1.0.0", |
| 10 | + "templateType": "Project", |
| 11 | + "author": "Plaster Project", |
| 12 | + "tags": [ |
| 13 | + "Module", |
| 14 | + "ModuleManifest", |
| 15 | + "Build" |
| 16 | + ] |
| 17 | + }, |
| 18 | + "parameters": [ |
| 19 | + { |
| 20 | + "name": "ModuleName", |
| 21 | + "type": "text", |
| 22 | + "prompt": "Enter the name of the module" |
| 23 | + }, |
| 24 | + { |
| 25 | + "name": "ModuleDesc", |
| 26 | + "type": "text", |
| 27 | + "prompt": "Enter a description of the module (required for publishing to the PowerShell Gallery)" |
| 28 | + }, |
| 29 | + { |
| 30 | + "name": "Version", |
| 31 | + "type": "text", |
| 32 | + "prompt": "Enter the version number of the module", |
| 33 | + "default": "0.1.0" |
| 34 | + }, |
| 35 | + { |
| 36 | + "name": "FullName", |
| 37 | + "type": "user-fullname", |
| 38 | + "prompt": "Enter your full name", |
| 39 | + "store": "text" |
| 40 | + }, |
| 41 | + { |
| 42 | + "name": "License", |
| 43 | + "type": "choice", |
| 44 | + "prompt": "Select a license (see http://choosealicense.com for help choosing):", |
| 45 | + "default": 0, |
| 46 | + "store": "text", |
| 47 | + "choices": [ |
| 48 | + { |
| 49 | + "label": "&None", |
| 50 | + "help": "No license.", |
| 51 | + "value": "None" |
| 52 | + }, |
| 53 | + { |
| 54 | + "label": "&Apache", |
| 55 | + "help": "Adds an Apache license file.", |
| 56 | + "value": "Apache" |
| 57 | + }, |
| 58 | + { |
| 59 | + "label": "&MIT", |
| 60 | + "help": "Adds an MIT license file.", |
| 61 | + "value": "MIT" |
| 62 | + } |
| 63 | + ] |
| 64 | + }, |
| 65 | + { |
| 66 | + "name": "Options", |
| 67 | + "type": "multichoice", |
| 68 | + "prompt": "Select one or more of the following tooling options:", |
| 69 | + "default": [ |
| 70 | + 1, |
| 71 | + 2, |
| 72 | + 3, |
| 73 | + 4 |
| 74 | + ], |
| 75 | + "store": "text", |
| 76 | + "choices": [ |
| 77 | + { |
| 78 | + "label": "&None", |
| 79 | + "help": "No tooling options specified.", |
| 80 | + "value": "None" |
| 81 | + }, |
| 82 | + { |
| 83 | + "label": "Add &Git .gitignore file", |
| 84 | + "help": "Adds a .gitignore file.", |
| 85 | + "value": "Git" |
| 86 | + }, |
| 87 | + { |
| 88 | + "label": "Add p&sake build script", |
| 89 | + "help": "Adds psake build script that generates the module directory for publishing to the PowerShell Gallery.", |
| 90 | + "value": "psake" |
| 91 | + }, |
| 92 | + { |
| 93 | + "label": "Add &Pester test support", |
| 94 | + "help": "Adds test directory and Pester test for the module manifest file.", |
| 95 | + "value": "Pester" |
| 96 | + }, |
| 97 | + { |
| 98 | + "label": "Add PSScript&Analyzer support", |
| 99 | + "help": "Adds script analysis support using PSScriptAnalyzer.", |
| 100 | + "value": "PSScriptAnalyzer" |
| 101 | + }, |
| 102 | + { |
| 103 | + "label": "Add plat&yPS help generation support", |
| 104 | + "help": "Adds help build support using platyPS.", |
| 105 | + "value": "platyPS" |
| 106 | + } |
| 107 | + ] |
| 108 | + }, |
| 109 | + { |
| 110 | + "name": "Editor", |
| 111 | + "type": "choice", |
| 112 | + "prompt": "Select one of the supported script editors for better editor integration (or None):", |
| 113 | + "default": 0, |
| 114 | + "store": "text", |
| 115 | + "choices": [ |
| 116 | + { |
| 117 | + "label": "&None", |
| 118 | + "help": "No editor specified.", |
| 119 | + "value": "None" |
| 120 | + }, |
| 121 | + { |
| 122 | + "label": "Visual Studio &Code", |
| 123 | + "help": "Your editor is Visual Studio Code.", |
| 124 | + "value": "VSCode" |
| 125 | + } |
| 126 | + ] |
| 127 | + } |
| 128 | + ], |
| 129 | + "content": [ |
| 130 | + { |
| 131 | + "type": "message", |
| 132 | + "text": "\n\n\nScaffolding your PowerShell Module...\n\n\n" |
| 133 | + }, |
| 134 | + { |
| 135 | + "type": "newModuleManifest", |
| 136 | + "destination": "src\\${ModuleName}.psd1", |
| 137 | + "moduleVersion": "${Version}", |
| 138 | + "rootModule": "${ModuleName}.psm1", |
| 139 | + "author": "${FullName}", |
| 140 | + "description": "${ModuleDesc}", |
| 141 | + "encoding": "UTF8-NoBOM" |
| 142 | + }, |
| 143 | + { |
| 144 | + "type": "file", |
| 145 | + "condition": "${Options} -contains 'Git'", |
| 146 | + "source": "_gitignore", |
| 147 | + "destination": ".gitignore" |
| 148 | + }, |
| 149 | + { |
| 150 | + "type": "file", |
| 151 | + "condition": "${Options} -contains 'psake'", |
| 152 | + "source": "build*.ps1", |
| 153 | + "destination": "" |
| 154 | + }, |
| 155 | + { |
| 156 | + "type": "file", |
| 157 | + "source": "ReleaseNotes.md", |
| 158 | + "destination": "" |
| 159 | + }, |
| 160 | + { |
| 161 | + "type": "file", |
| 162 | + "source": "src\\Module.psm1", |
| 163 | + "destination": "src\\${ModuleName}.psm1" |
| 164 | + }, |
| 165 | + { |
| 166 | + "type": "file", |
| 167 | + "source": "ScriptAnalyzerSettings.psd1", |
| 168 | + "destination": "" |
| 169 | + }, |
| 170 | + { |
| 171 | + "type": "templateFile", |
| 172 | + "condition": "${Options} -contains 'platyPS'", |
| 173 | + "source": "docs\\en-US\\about_Module.help.md", |
| 174 | + "destination": "docs\\en-US\\about_${ModuleName}.help.md" |
| 175 | + }, |
| 176 | + { |
| 177 | + "type": "templateFile", |
| 178 | + "condition": "${Options} -notcontains 'platyPS'", |
| 179 | + "source": "docs\\en-US\\about_Module.help.txt", |
| 180 | + "destination": "src\\en-US\\about_${ModuleName}.help.txt" |
| 181 | + }, |
| 182 | + { |
| 183 | + "type": "templateFile", |
| 184 | + "condition": "${Options} -contains 'Pester'", |
| 185 | + "source": "test\\Module.T.ps1", |
| 186 | + "destination": "test\\${ModuleName}.Tests.ps1" |
| 187 | + }, |
| 188 | + { |
| 189 | + "type": "templateFile", |
| 190 | + "condition": "${Options} -contains 'Pester'", |
| 191 | + "source": "test\\Shared.ps1", |
| 192 | + "destination": "test\\Shared.ps1" |
| 193 | + }, |
| 194 | + { |
| 195 | + "type": "templateFile", |
| 196 | + "condition": "${License} -eq 'Apache'", |
| 197 | + "source": "license\\Apache.txt", |
| 198 | + "destination": "LICENSE.txt", |
| 199 | + "encoding": "UTF8-NoBOM" |
| 200 | + }, |
| 201 | + { |
| 202 | + "type": "templateFile", |
| 203 | + "condition": "${License} -eq 'MIT'", |
| 204 | + "source": "license\\MIT.txt", |
| 205 | + "destination": "LICENSE.txt" |
| 206 | + }, |
| 207 | + { |
| 208 | + "type": "file", |
| 209 | + "condition": "(${Editor} -eq 'VSCode') -and (${Options} -notcontains 'psake') -and (${Options} -contains 'Pester')", |
| 210 | + "source": "editor\\VSCode\\tasks_pester.json", |
| 211 | + "destination": ".vscode\\tasks.json" |
| 212 | + }, |
| 213 | + { |
| 214 | + "type": "file", |
| 215 | + "condition": "(${Editor} -eq 'VSCode') -and (${Options} -contains 'psake') -and (${Options} -notcontains 'Pester')", |
| 216 | + "source": "editor\\VSCode\\tasks_psake.json", |
| 217 | + "destination": ".vscode\\tasks.json" |
| 218 | + }, |
| 219 | + { |
| 220 | + "type": "file", |
| 221 | + "condition": "(${Editor} -eq 'VSCode') -and (${Options} -contains 'psake') -and (${Options} -contains 'Pester')", |
| 222 | + "source": "editor\\VSCode\\tasks_psake_pester.json", |
| 223 | + "destination": ".vscode\\tasks.json" |
| 224 | + }, |
| 225 | + { |
| 226 | + "type": "file", |
| 227 | + "condition": "(${Editor} -eq 'VSCode') -and (${Options} -contains 'PSScriptAnalyzer')", |
| 228 | + "source": "editor\\VSCode\\settings.json", |
| 229 | + "destination": ".vscode\\settings.json" |
| 230 | + }, |
| 231 | + { |
| 232 | + "type": "requireModule", |
| 233 | + "name": "Pester", |
| 234 | + "condition": "${Options} -contains 'Pester'", |
| 235 | + "minimumVersion": "3.4.0", |
| 236 | + "message": "Without Pester, you will not be able to run the provided Pester test to validate your module manifest file.\nWithout version 3.4.0, VS Code will not display Pester warnings and errors in the Problems panel." |
| 237 | + }, |
| 238 | + { |
| 239 | + "type": "requireModule", |
| 240 | + "name": "psake", |
| 241 | + "condition": "${Options} -contains 'psake'", |
| 242 | + "message": "Without psake, you will not be able to run the provided build script to build and/or publish your module." |
| 243 | + }, |
| 244 | + { |
| 245 | + "type": "requireModule", |
| 246 | + "name": "PSScriptAnalyzer", |
| 247 | + "condition": "${Options} -contains 'PSScriptAnalyzer'", |
| 248 | + "message": "Without PSScriptAnalyzer, you will not be able to perform script analysis, or use the provided options to control script analysis." |
| 249 | + }, |
| 250 | + { |
| 251 | + "type": "requireModule", |
| 252 | + "name": "platyPS", |
| 253 | + "condition": "${Options} -contains 'platyPS'", |
| 254 | + "minimumVersion": "0.7.2", |
| 255 | + "message": "Without platyPS, you will not be able to generate PowerShell external help for your module using markdown." |
| 256 | + }, |
| 257 | + { |
| 258 | + "type": "message", |
| 259 | + "text": "\nYour new PowerShell module project '${ModuleName}' has been created.\n\n" |
| 260 | + }, |
| 261 | + { |
| 262 | + "type": "message", |
| 263 | + "condition": "${Options} -contains 'Pester'", |
| 264 | + "text": "A Pester test has been created to validate the module's manifest file. Add additional tests to the test directory.\nYou can run the Pester tests in your project by executing the 'test' task. Press Ctrl+P, then type 'task test'.\n\n" |
| 265 | + }, |
| 266 | + { |
| 267 | + "type": "message", |
| 268 | + "condition": "${Options} -contains 'psake'", |
| 269 | + "text": "You can build your project by executing the 'build' task. Press Ctrl+P, then type 'task build'.\nYou can publish your project to the PSGallery by pressing Ctrl+P, then type 'task publish'.\n\n" |
| 270 | + }, |
| 271 | + { |
| 272 | + "type": "message", |
| 273 | + "condition": "(${Options} -contains 'psake') -and (${Options} -contains 'platyPS')", |
| 274 | + "text": "You can generate help and additional documentation using platyPS by running the 'build help' task. Press Ctrl+P,\nthen type 'task build help'. Add additional documentation written in platyPS markdown to the docs directory. You can\nupdate the help by running the 'build help' task again.\n\n" |
| 275 | + } |
| 276 | + ] |
| 277 | +} |
0 commit comments