Describe the change
Add support for array input for New-DynamicParam
Context 'Integration - Pipelined construction - more pipeline' {
BeforeAll {
filter Test-DynParam {
<#
.SYNOPSIS
This is a test of dynamic parameters.
#>
[CmdletBinding()]
param (
[Parameter()]
[ValidateSet('A', 'B', 'C')]
[string]$Param1
)
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 | New-DynamicParam | New-DynamicParamDictionary
}
process {
$Variable = $PSBoundParameters['Variable']
$EnvironmentVariable = $PSBoundParameters['EnvironmentVariable']
Write-Verbose "Variable: $Variable"
Write-Verbose "EnvironmentVariable: $EnvironmentVariable"
}
}
}
It 'Test-DynParam should not throw an exception' {
{ Test-DynParam -Variable HOME -EnvironmentVariable RUNNER_OS -Verbose } | Should -Not -Throw
}
}
Describe the change
Add support for array input for
New-DynamicParam