PowerRails - A module to generate your scripts folder structure.
Most scripts/modules have a similar directory structure. You shouldn't waste your time creating it. Just use this module to get a head start and add to your new structure as needed.
PowerRails will also helps you to become a better developer.
We include the following helpers to keep you on track 🚆 (pun intended).
- Script Analyzer is a set of rules that are based on guidance from the PowerShell team. By default we enforce these rules.
- Pester is a framework for running unit tests to execute and validate PowerShell commands. You should test your code. Pester helps you with that. Sample tests included.
- PSake is a build automation tool written in PowerShell. Builds glue everything together. Analyze your script, run your unit testing and deploy!
- PSDeploy is a quick and dirty module that simplifies deployments. If everything checks out, deploy our script to where ever you'd like.
There is only 1 cmdlet to learn. New-PowerRailsItem PowerRails is semi-opinioned in the tabs vs spaces discussion. We prefer spaces but I've included a switch to use tabs if you prefer.
PS> Install-Module -Name PowerRails
PS> Import-Module -Name PowerRails
PS> New-PowerRailsItem -name 'GitHubScrapper' -type 'script' -path '.'
PS> New-PowerRailsItem -name 'MakeMyLifeEasier' -path 'c:\scripts\'
PS> Get-Help New-PowerRailsItem
- Test the script via Pester and Script Analyzer
PS> .\build.ps1
- Test the script with Pester only
PS> .\build.ps1 -Task Test
- Test the script with Script Analyzer only
PS> .\build.ps1 -Task Analyze
- Deploy the script via PSDeploy (runs all tests)
PS> .\build.ps1 -Task Deploy
This module was inspired by the post by Dev Black Ops Great read. Highly recommended.
Big thanks to FreePik for the logo.