exmple_code_file.ps1
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
$host_name = Read-Host "Please enter a host"
$port = Read-Host "Please enter a port"
$database = Read-Host "Please enter a database"
$user = Read-Host "Please enter a user"
$password = Read-Host "Please enter a password"
# Path to Devart.Shell.Core.dll
$dllPath = "C:\Program Files\Devart\dbForge Studio for MySQL\Devart.Shell.Core.dll"
Add-Type -Path $dllPath
$encryptedPassword = [Devart.Shell.Common.Utils.MiscUtils]::EncodeString($password)
$ConnectionString = "User Id=" + $user + ";Host=" + $host_name + ";Port=" + $port + ";Database=" + $database
$RegConnectionMySQLFolder = "HKCU:\SOFTWARE\Devart\dbForge Common Settings\Connections\MySQL\"
$connection_name = $database + "." + $host_name + ":" + $port
$n = 0
New-Item -Path $RegConnectionMySQLFolder -Name $n
$RegConnectionMySQL_n = $RegConnectionMySQLFolder + $n
New-ItemProperty -Path $RegConnectionMySQL_n -Name "ConnectionString" -Value $ConnectionString -PropertyType "String"
New-ItemProperty -Path $RegConnectionMySQL_n -Name "Database" -Value "59f90733-4d68-4fdf-82a7-f0fcbf5460aa"
New-ItemProperty -Path $RegConnectionMySQL_n -Name "Name" -Value $connection_name
New-ItemProperty -Path $RegConnectionMySQL_n -Name "Password" -Value $encryptedPassword -PropertyType Binary