-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathInitialize-ConfigurationObject.ps1
More file actions
50 lines (46 loc) · 1.82 KB
/
Initialize-ConfigurationObject.ps1
File metadata and controls
50 lines (46 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function Initialize-ConfigurationObject {
param(
[Parameter(Mandatory = $false)]
[ValidateSet("bicep", "terraform")]
[string] $alzIacProvider = "bicep"
)
<#
.SYNOPSIS
This function uses a template configuration to prompt for and return a user specified/modified configuration object.
.EXAMPLE
Initialize-ConfigurationObject
.EXAMPLE
Initialize-ConfigurationObject -alzIacProvider "bicep"
.OUTPUTS
System.Object. The resultant configuration values.
#>
if ($alzIacProvider -eq "terraform") {
throw "Terraform is not yet supported."
}
return [pscustomobject]@{
Prefix = [pscustomobject]@{
description = "The prefix that will be added to all resources created by this deployment."
names = @("parTopLevelManagementGroupPrefix", "parCompanyPrefix")
value = "alz"
defaultValue = "alz"
}
Suffix = [pscustomobject]@{
Description = "The suffix that will be added to all resources created by this deployment."
Names = @("parTopLevelManagementGroupSuffix")
Value = ""
DefaultValue = ""
}
Location = [pscustomobject]@{
Description = "Deployment location."
Names = @("parLocation")
AllowedValues = @(Get-AzLocation | Sort-Object Location | Select-Object -ExpandProperty Location )
Value = ""
}
Environment = [pscustomobject]@{
Description = "The type of environment that will be created . Example: dev, test, qa, staging, prod"
Names = @("parEnvironment")
DefaultValue = 'prod'
Value = ""
}
}
}