Skip to content

PowerShell script that creates a new file structure for the developement of a PowerShell script or module with an optional Git repository.

License

Notifications You must be signed in to change notification settings

adzero/New-PSDevelopmentProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

New-PSDevelopmentProject

About

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 :
  1. bin folder for any binaries required
  2. lib folder for any libraries required
  3. en-US localized folder with PowerShell topic about_ help file (only for modules)
  4. Public/Private folders for modules functions files (only for modules)
  5. Script or Root module script with its manifest file
  6. 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.

Prerequisites

  • PowerShell (V5, previous versions untested)
  • PowerShellGet module (required for script info initialization)
  • Git (optional)

Parameters

Name

The name of the new PowerShell script/module. (Mandatory)

Author

The author of the new PowerShell script/module. (Mandatory)

Description

Short description of the new PowerShell script/module. (Mandatory)

RootPath

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 "$($env:HOMEDRIVE)$($env:HOMEPATH)\Documents\WindowsPowerShell".

ScriptProject

Switch option to use for a script project creation. (Mandatory)

ModuleProject

Switch option to use for a module project creation. (Mandatory)

GitRepository

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.

Examples

New script project

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" -ScriptProject

New Module project with Git repository

C:\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

About

PowerShell script that creates a new file structure for the developement of a PowerShell script or module with an optional Git repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published