AlonGvili / CrescendoMiddleware

Middleware for generating Crescendo PowerShell modules from .NET command line tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crescendo Middleware

Middleware for generating Crescendo PowerShell modules from .NET command line tools using System.CommandLine

Usage

You will need to map your commands to PowerShell cmdlets and add the Crescendo middleware.

commandLineBuilder.AddCrescendoMiddleware(opts =>
{
    opts.AddCmdletMapping("Get-Message", rootCommand);
});

Once this is done, you can call your executable with --crescendo.

.\ConsoleApp.exe --crescendo

A crescendo JSON file will be generated. Create your module with Crescendo.

Install-Module Microsoft.PowerShell.Crescendo 
Export-CrescendoModule -ConfigurationFile ConsoleApp.crescendo.json -ModuleName ConsoleApp

You can then import that module and call the imported cmdlets.

PS> Import-Module .\ConsoleApp.psd1
PS> Get-Message -message test
 --delay = 0
--message = Test

About

Middleware for generating Crescendo PowerShell modules from .NET command line tools.

License:MIT License


Languages

Language:C# 100.0%