Skip to content

Skeleton for a new PowerShell module, including tests and build.

Notifications You must be signed in to change notification settings

naumanbasheer/powershell-module-skeleton

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

branch status
master Build status

PowerShellModuleSkeleton

Basic skeleton structure for a new PowerShell module with public and private (not exposed to user) function support, tests, and module manifest.

Getting Started

-Rename all instances of 'PowerShellModuleSkeleton' to < YourProjectName >. -Add new functions to the PowerShellModuleSkeleton\public\ folder, and update the manifest (*.psd1) file with the new functions to export.

Testing locally

To import the module locally without having to copy it to on of the defualt $psmoduleroot paths, navigate to within the module's root direction, and import the module from the current directory:

Import-Module .\
Test-PublicFunction -something 'print something'
Test-PublicFunction -something 'setting the verbose switch will output the same message to the verbose stream, since the [cmdletingbinding()] decorator was used.'

Install the module from PowerShell Gallery:

Install-Module PowerShellModuleSkeleton
Test-PublicFunction

CI/CD via Azure DevOps

Setting up a build in AzureDevops is trivial, and allows for unit testing with pester and static code analysis using PSSCriptAnalyzer -- followed by a release job that deploys the package to the PowerShell Gallery.

todo: describe setting up build and relase.

build summary

tests summary

About

Skeleton for a new PowerShell module, including tests and build.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 100.0%