Last active
January 3, 2023 02:49
-
-
Save techthoughts2/2b3190cd0117acb79ac2306f00667a92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DynamicParam { | |
if (-not [String]::IsNullOrWhiteSpace($CICDChoice) -and $script:repoToCICD.ContainsKey($CICDChoice) ) { | |
$attrRepo = [System.Management.Automation.ParameterAttribute]::new() | |
$attrRepo.ParameterSetName = 'Choice' | |
$attrRepo.Mandatory = $true | |
$attrRepo.HelpMessage = 'TBD' | |
$attrRepoValidation = [System.Management.Automation.ValidateSetAttribute]::new([String[]]$script:repoToCICD[$CICDChoice]) | |
$attributeCollection = [System.Collections.ObjectModel.Collection[System.Attribute]]::new() | |
$attributeCollection.Add($attrRepo) | |
$attributeCollection.Add($attrRepoValidation ) | |
$param = [System.Management.Automation.RuntimeDefinedParameter]::new('Repository', [String], $attributeCollection) | |
$paramDict = [System.Management.Automation.RuntimeDefinedParameterDictionary]::new() | |
$paramDict.Add('Repository', $param) | |
return $paramDict | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment