- 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.
26 lines
1.1 KiB
PowerShell
26 lines
1.1 KiB
PowerShell
function Export-ConfigurationData {
|
|
$result = (
|
|
[DialogBuilder]::SaveFile().
|
|
SetTitle("Konfiguration speichern").
|
|
SetCommonFilter("PSD1").
|
|
SetInitialDirectory($settingsManager.Get("DeploymentPath")).
|
|
SetFileName("merged_config.psd1").
|
|
SetOverwritePrompt($true).
|
|
Show()
|
|
)
|
|
if ($result.Result) {
|
|
try {
|
|
$ConfigurationData = $script:ResolvedConfigurationData
|
|
if($null -eq $ConfigurationData){
|
|
throw "Keine aufgelöste ConfigurationData zum Exportieren vorhanden."
|
|
}
|
|
|
|
Export-Hashtable -Hashtable $ConfigurationData -Path $result.FileName
|
|
[System.Windows.Forms.MessageBox]::Show("Export war erfolgreich", "Info", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)
|
|
}
|
|
catch {
|
|
[System.Windows.Forms.MessageBox]::Show("Export war nicht erfolgreich", "Info", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Error)
|
|
}
|
|
}
|
|
}
|