Issues through PowerShell

rovsing's profile image rovsing posted 1 year ago in Creating a connection Permalink

Hi there

I've created the below script in powershell so it should be working as a cmdlet, however I'm getting the error:

Could not execute SSH command:
database-server -p 22 -N -L 3307:database-server:3306
System mesage: Wrong parameter

My powershell scripts is the following, and I'm trying to connect in powershell with "gomysql server.url"

function gomysql {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [string]$Url
    )

    & 'C:\folder\heidisql.exe' `
        -h 'database-server' `
        -u 'admin' `
        -p '************************' `
        -P 3306 `
        -n 2 `
        -l 'libmariadb.dll' `
        -sshhost=$Url `
        -sshuser=dr `
        -sshpass='************' `
        -sshkeyfile='C:\folder\key.ppk' `
        -sshport=3307 `
        -sshplinkexe='C:\folder\plink.exe'
}

This particular setup works fine within HeidiSQL.

ansgar's profile image ansgar posted 1 year ago Permalink

These arguments starting with "ssh..." are not supported by HeidiSQL, where did you take them from? The others are supported, but should be used with double quotes instead of single quotes for the values. I'm just not sure if PowerShell "eats" these single quotes, or what exactly happens.

I recommend to use the description/d argument instead, to use a preconfigured HeidiSQL session:

c:\folder\heidisql.exe -d="My session"

However, there is still no way to pass an SSH hostname.

Please login to leave a reply, or register at first.