Skip to content

Library for creating PowerShell dynamic parameters for binary cmdlets

License

Notifications You must be signed in to change notification settings

fireflycons/PSDynamicParameters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7a0c4aa · Aug 3, 2021

History

19 Commits
Apr 25, 2021
May 25, 2020
Apr 25, 2021
May 25, 2020
Apr 26, 2020
Apr 14, 2020
Apr 14, 2020
Aug 20, 2020
Apr 25, 2021
Aug 3, 2021
Apr 14, 2020

Repository files navigation

Firefly.PowerShell.DynamicParameters

Build status

Nuget

A library for the creation of runtime dynamic parameters for binary cmdlets.

When creating a binary cmdlet, there are two ways that you can declare dynamic parameters:

  1. When you know all the parameters you'll ever need at compile time, you can declare each parameter type in its own class. An example of this can be found in this PowerShell Magazine article
  2. When you don't necessarily know what parameters you'll need and you will create them on the fly in response to the values passed to the cmdlet's fixed arguments, then we need to create a RuntimeDefinedParameterDictionary.

This library handles the second case above. By implementing a builder pattern to create new dynamic paramaters, this makes it easy to manage the myriad attributes that may be applied to a cmdlet parameter.

Supported PowerShell Versions

The nuget package contains the following builds

  • .NET Framework 4.0 - Windows PowerShell 5.1
  • .NET Core 2.1 - PowerShell Core 6 (Windows/Linux/MacOS) - With PS 6 features.
  • .NET Core 3.1 - PowerShell Core 7 (Windows/Linux/MacOS) - With PS 7 Features
  • .NET Standard 2.0 - Powershell >= 5.1 (Cross Platform) - PS 5.1 features

Tests are run on all three platforms for both PowerShell Core versions.

Library Documentation

API documentation and example usage can be found here.

About

Library for creating PowerShell dynamic parameters for binary cmdlets

Resources

License

Stars

Watchers

Forks

Packages

No packages published