From ed856e4adf4c42c4abc4428c2e5ddcb1076a16f5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 6 Jul 2026 08:26:47 +0200 Subject: [PATCH 1/3] Standardize README landing page --- README.md | 156 ++++-------------------------------------------------- 1 file changed, 9 insertions(+), 147 deletions(-) diff --git a/README.md b/README.md index be437c8..97a2960 100644 --- a/README.md +++ b/README.md @@ -1,165 +1,27 @@ # DynamicParams -A PowerShell module that makes it easier to use dynamic params. - -## Prerequisites - -No prerequisites are required to use this module. +DynamicParams is a PowerShell module that makes it easier to build dynamic parameters. ## Installation -Provide step-by-step instructions on how to install the module, including any InstallModule commands or manual installation steps. +Install the module from the PowerShell Gallery: ```powershell -Install-Module -Name DynamicParams +Install-PSResource -Name DynamicParams Import-Module -Name DynamicParams ``` -## Usage - -Here is a list of example that are typical use cases for the module. -This section should provide a good overview of the module's capabilities. - -### Use dynamic parameters in a function - -Here is an example of how to use dynamic parameters in a function. - -```powershell -#Requires -Modules DynamicParams - -function Get-Info { - [CmdletBinding()] - param () - - dynamicparam { - $DynamicParamDictionary = New-DynamicParamDictionary - - $dynParam = @{ - Name = 'Process' - Alias = 'proc' - Type = [string] - ValidateSet = Get-Process | Select-Object -ExpandProperty Name -Unique - DynamicParamDictionary = $DynamicParamDictionary - } - New-DynamicParam @dynParam - - $dynParam2 = @{ - Name = 'Service' - Alias = 'svc' - Type = [string] - ValidateSet = Get-Service | Select-Object -ExpandProperty Name -Unique - DynamicParamDictionary = $DynamicParamDictionary - } - New-DynamicParam @dynParam2 - - return $DynamicParamDictionary - } - - ... - process { - $process = $PSBoundParameters['Process'] - $service = $PSBoundParameters['Service'] - ... - } - ... -} - -``` - -### Use dynamic parameters in a function - DSL Style - -Here is an example of how to use dynamic parameters in a function. - -```powershell -#Requires -Modules DynamicParams - -function Get-Info { - [CmdletBinding()] - param () - - dynamicparam { - DynamicParams @( - @{ - Name = 'Process' - Alias = 'proc' - Type = [string] - ValidateSet = Get-Process | Select-Object -ExpandProperty Name -Unique - } - @{ - Name = 'Service' - Alias = 'svc' - Type = [string] - ValidateSet = Get-Service | Select-Object -ExpandProperty Name -Unique - } - ) - } +## Documentation - ... - process { - $process = $PSBoundParameters['Process'] - $service = $PSBoundParameters['Service'] - ... - } - ... -} - -``` +Documentation is published at [psmodule.io/DynamicParams](https://psmodule.io/DynamicParams/). -### Use dynamic parameters in a function - Pipeline style - -Here is an example of how to use dynamic parameters in a function. +Use PowerShell help and command discovery for module details: ```powershell -#Requires -Modules DynamicParams - -function Get-Info { - [CmdletBinding()] - param () - - dynamicparam { - $params = @( - @{ - Name = 'Variable' - Type = [string] - ValidateSet = Get-Variable | Select-Object -ExpandProperty Name - }, - @{ - Name = 'EnvironmentVariable' - Type = [string] - ValidateSet = Get-ChildItem -Path env: | Select-Object -ExpandProperty Name - } - ) - - $params | ForEach-Object { New-DynamicParam @_ } | New-DynamicParamDictionary - } - - ... - process { - $process = $PSBoundParameters['Process'] - $service = $PSBoundParameters['Service'] - ... - } - ... -} - +Get-Command -Module DynamicParams +Get-Help -Examples ``` - ## Contributing -Coder or not, you can contribute to the project! We welcome all contributions. - -### For Users - -If you don't code, you still sit on valuable information that can make this project even better. If you experience that the -product does unexpected things, throw errors or is missing functionality, you can help by submitting bugs and feature requests. -Please see the issues tab on this project and submit a new issue that matches your needs. - -### For Developers - -If you do code, we'd love to have your contributions. Please read the [Contribution guidelines](CONTRIBUTING.md) for more information. -You can either help by picking up an existing issue or submit a new one if you have an idea for a new feature or improvement. - -## Links - -- [about_Functions_Advanced_Parameters | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7.4#dynamic-parameters) +Issues and pull requests are welcome. Please use the repository issue tracker to report bugs, request features, or discuss improvements. From 1b5fb79bca2b0669bb3bc8dd56641af08db8e3db Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 6 Jul 2026 10:31:33 +0200 Subject: [PATCH 2/3] Address Copilot README review --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 97a2960..559e578 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ DynamicParams is a PowerShell module that makes it easier to build dynamic param Install the module from the PowerShell Gallery: +```powershell +Install-Module -Name DynamicParams +``` + +Or with PSResourceGet: + ```powershell Install-PSResource -Name DynamicParams Import-Module -Name DynamicParams From ab3e3d2767ff53997d0efce1e9a974a83fc30221 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 6 Jul 2026 10:57:47 +0200 Subject: [PATCH 3/3] Address Copilot README review --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 559e578..f4d3f85 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Install the module from the PowerShell Gallery: ```powershell Install-Module -Name DynamicParams +Import-Module -Name DynamicParams ``` Or with PSResourceGet: @@ -25,7 +26,7 @@ Use PowerShell help and command discovery for module details: ```powershell Get-Command -Module DynamicParams -Get-Help -Examples +Get-Help New-DynamicParam -Examples ``` ## Contributing