New-PSDevelopmentProject.ps1 is a PowerShell script that creates a new file structure for the developement of a PowerShell script or module with an optional Git repository. The project contains :
- License file (MIT License by default)
- Markdown Readme file
- Tests folder with empty test script
- Source code folder with following files :
- bin folder for any binaries required
- lib folder for any libraries required
- en-US localized folder with PowerShell topic about_ help file (only for modules)
- Public/Private folders for modules functions files (only for modules)
- Script or Root module script with its manifest file
- Optional custom types definition file
Thanks to Warren Frame and his blog post Building a PowerShell Module from which the module file structure and code was taken.
- PowerShell (V5, previous versions untested)
- PowerShellGet module (required for script info initialization)
- Git (optional)
The name of the new PowerShell script/module. (Mandatory)
The author of the new PowerShell script/module. (Mandatory)
Short description of the new PowerShell script/module. (Mandatory)
The root path where to create new project directory :
- Script projects will be located under a Scripts directory.
- Module projects will be located under a Modules directory.
If not specified, default value is "$(
Switch option to use for a script project creation. (Mandatory)
Switch option to use for a module project creation. (Mandatory)
Switch option to initialize a new git repository in the project root directory. First commit of the master branch only contains blank gitignore file. All files created, tracked and uncommited in a new dev branch.
C:\Users\adzero\Documents\WindowsPowerShell\Scripts> .\New-PSDevelopmentProject.ps1 -Name HelloWorldScript -Author AdZero -Description "A little script to say Hello !" -RootPath "C:\Users\AdZero\Documents\WindowsPowerShell\dev" -ScriptProjectC:\Users\adzero\Documents\WindowsPowerShell\Scripts> .\New-PSDevelopmentProject.ps1 -Name DemoModule -Author AdZero -Description "A new PS module" -RootPath "C:\Users\AdZero\Documents\WindowsPowerShell\dev" -ModuleProject -GitRepository