Initial commit
This commit is contained in:
24
Functions/Export-ConfigurationData.ps1
Normal file
24
Functions/Export-ConfigurationData.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
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 = @{
|
||||
"Resources" = $(ConvertFrom-TreeView -TreeView $treeView -SkipRootNode)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user