Importing from WinSCP Importing from WinSCP

Importing from WinSCP

Dmitry Babinsky Dmitry Babinsky

This article describes how to import data from WinSCP.

For that you'll need to:

  1. export the data from WinSCP via 'Export/Backup configuration',
  2. convert the exported file to an SSH config file (see below),
  3. import the SSH config file into Termius.

Convert from WinSCP

Before running the script, replace .\WinSCP.ini in it with the location of the file created by WinSCP.

$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
cat .\WinSCP.ini |
where { $_ -match '(HostName=)|(UserName=)|(PortNumber=)|(PublicKeyFile=)|(Sessions\\)' } |
%{ $_ -replace '\[Sessions\\(.*)\]', 'Host "$1"' } |
%{ $_ -replace 'HostName=',' HostName ' -replace 'UserName=',' User ' -replace 'PortNumber=',' Port ' -replace 'PublicKeyFile=(.*)',' IdentifyFile "$1"' } |
%{ [uri]::UnescapeDataString($_)
}>ssh_config

If you're having difficulty importing data, please, contact us.

Add comment

Please sign in to leave a comment.