2025-08-05 18:24:59 +02:00
|
|
|
function Invoke-AutoConfigDialog {
|
|
|
|
|
|
|
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Sets the automatic configuration file based on a specified JSON file
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
|
|
|
|
|
$OFD = New-Object System.Windows.Forms.OpenFileDialog
|
|
|
|
|
$OFD.Filter = "JSON Files (*.json)|*.json"
|
|
|
|
|
$OFD.ShowDialog()
|
|
|
|
|
|
2026-02-06 18:29:10 +02:00
|
|
|
if ($OFD.FileName -eq "")
|
2025-08-05 18:24:59 +02:00
|
|
|
{
|
|
|
|
|
Write-Host "No automatic config file has been selected. Continuing without one..."
|
|
|
|
|
return
|
|
|
|
|
}
|
2026-02-06 18:29:10 +02:00
|
|
|
|
|
|
|
|
return $OFD.FileName
|
2025-08-05 18:24:59 +02:00
|
|
|
}
|