Skip to content

Conversation

@lovelysandwich
Copy link
Contributor

@lovelysandwich lovelysandwich commented Mar 21, 2023

Pull Request

An mechanism which allows for dynamically calculated AllowedValues to be specified. Also configurable whether the allowed values are displayed or not.
Note. This might be entirely too configurable - what do you think about this approach...(?)

Issue

Azure/Azure-Landing-Zones#2567

Description

  • Locations can be dynamically calculated again.
  • Allowed Values can be displayed or not based on configuration.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.

@lovelysandwich lovelysandwich changed the title Adding dynamic allowed value creation Adding dynamic allowed value creation, hiding allowed values and filtering invalid dynamically created allowed values. Mar 21, 2023
"Display": false,
"Description": "Getting Azure deployment locations.",
"Type": "PSScript",
"Script": "Get-AzLocation | Sort-Object Location | Select-Object -ExpandProperty Location | Where-Object {$_ -notmatch 'asia|(.*)stage$'}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any values I should have removed with this pretty naïve Regex?

$allowedValues = $configValue.AllowedValues
$hasAllowedValues = $null -ne $configValue.AllowedValues
#if the file has a script - execute it:
if ($null -ne $configValue.AllowedValues -and $configValue.AllowedValues.Type -eq "PSScript") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script execution might be a bit weird... Happy to discuss...

@lovelysandwich lovelysandwich marked this pull request as ready for review March 21, 2023 11:36
@lovelysandwich lovelysandwich merged commit 7245201 into main Mar 21, 2023
@lovelysandwich lovelysandwich deleted the bug/fix_location_display branch March 21, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants