This project is aimed to create set of simple PowerShell cmdlets in C# that would assist developers in writing PowerShell modules.
Planned list of commands is:
New-STBasicFunction
- creates simple PowerShell functionNew-STAdvancedFunction
- create PS function with begin, process and end blocksNew-STTestCase
- creates a Pester test case
Ultimately, all of this will be followed by New-STModule
and maybe more (pipelines, documentation, etc.)
Project is done in scope of Hacktoberfest 2022
- https://hacktoberfest.com/
- Using C# to Create PowerShell Cmdlets: The Basics @red-gate.com
- How to create a Standard Library binary module @learn.microsoft.com
- Using Visual Studio Code to debug compiled cmdlets
- https://github.com/PowershellFrameworkCollective/psframework - active
- https://github.com/PowerShellOrg/Plaster - legendary, but last PR in 2021
- https://github.com/PoshCode/ModuleBuilder - last release in 2020
Run dotnet
commands:
dotnet new -i Microsoft.PowerShell.Standard.Module.Template
dotnet new psmodule
dotnet new gitignore
dotnet build
Then, verify it in PowerShell:
Import-Module '.\bin\Debug\netstandard2.0\Simple_Templates.dll'
Get-Module 'Simple_Templates'
Test-SampleCmdlet 12
It should generate output similar to this:
FavoriteNumber FavoritePet
-------------- -----------
12 Dog