- Updated Export-ConfigurationData to use resolved configuration data directly and added error handling for missing data. - Enhanced Load-Templates to streamline category loading and improve error handling for missing template directories. - Removed Merge-ConfigurationData function as it is no longer needed. - Refactored Merge-Templates to improve merging logic and handle default files more effectively. - Introduced Get-TemplatePreviewData function to handle template preview data retrieval and merging. - Added Import-OrderedPowerShellDataFile function to support ordered hashtable imports. - Updated Update-ParametersPanel to handle parameter and variable tab updates more efficiently. - Improved Update-TreeView to handle cases where resources are not found. - Added new parameters to Environment.Default.psd1 for Active Directory configuration. - Created new template BGW-LAN.psd1 for domain configuration.
66 lines
1.8 KiB
PowerShell
66 lines
1.8 KiB
PowerShell
function Update-ParametersPanel {
|
|
Param(
|
|
[System.Collections.Hashtable] $ConfigurationData
|
|
)
|
|
|
|
foreach ($tabName in @("Parameters", "Variables")) {
|
|
$existingTabs = @($tabControl.Controls | Where-Object { $_.Text -eq $tabName })
|
|
foreach ($tab in $existingTabs) {
|
|
$tabControl.Controls.Remove($tab)
|
|
$tab.Dispose()
|
|
}
|
|
}
|
|
|
|
if ($null -eq $ConfigurationData) {
|
|
return
|
|
}
|
|
|
|
if ($ConfigurationData.Contains("Parameters")) {
|
|
$parametersTabPage = (
|
|
[TabPageBuilder]::new("Parameters").
|
|
Build()
|
|
)
|
|
|
|
$gridView = (
|
|
[DataGridViewBuilder]::new().
|
|
SetHeaderColumns(@("Name", "Value", "Type", "Required")).
|
|
SetHeaderColumnReadOnly("Name").
|
|
Build()
|
|
)
|
|
|
|
foreach ($parameter in $ConfigurationData.Parameters.GetEnumerator()) {
|
|
$value = $parameter.Value
|
|
$gridView.Rows.Add(
|
|
$parameter.Name,
|
|
$value.Value,
|
|
$value.Type,
|
|
$value.Required
|
|
) | Out-Null
|
|
}
|
|
|
|
$parametersTabPage.Controls.Add($gridView)
|
|
$tabControl.Controls.Add($parametersTabPage)
|
|
}
|
|
|
|
if ($ConfigurationData.Contains("Variables")) {
|
|
$variablesTabPage = (
|
|
[TabPageBuilder]::new("Variables").
|
|
Build()
|
|
)
|
|
|
|
$gridView = (
|
|
[DataGridViewBuilder]::new().
|
|
SetHeaderColumns(@("Name", "Value")).
|
|
SetHeaderColumnReadOnly("Name").
|
|
Build()
|
|
)
|
|
|
|
foreach ($variable in $ConfigurationData.Variables.GetEnumerator()) {
|
|
$gridView.Rows.Add($variable.Name, $variable.Value) | Out-Null
|
|
}
|
|
|
|
$variablesTabPage.Controls.Add($gridView)
|
|
$tabControl.Controls.Add($variablesTabPage)
|
|
}
|
|
}
|