Does this work for you?
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\encryptedpassword> Add-Type -Path "WinSCPnet.dll"
PS C:\encryptedpassword> Read-Host -AsSecureString | ConvertFrom-SecureString
**** # (typing "abcd" here)
01000000d08c9ddf0115d1118c7a00c04fc297eb01000000ad3b4991ec7d52438797134bcb02a15c0000000002000000000010660000000100002000000029a0dd2613bd7b04b1383c100bd2c30136a3a1c10b4d9110deda0e6c2fdc8203000000000e800000000200002000000091377bbd4b80c3bfa5c8f675a5db95b4ebf970dac04b2c93825057209ef4813e1000000026d47d10fefe37b91a90753e20894f2140000000d403186869d8b0d9171456eb97a1c7fe28b90d6b591e75976c5425d02ba96fa7b58c2c57d275f0a8d18cd88baaca39f415cad49434457119d1830ddf2c5e44f5
PS C:\encryptedpassword> $sessionOptions = New-Object WinSCP.SessionOptions
PS C:\encryptedpassword> $sessionOptions.SecurePassword = ConvertTo-SecureString "01000000d08c9ddf0115d1118c7a00c04fc297eb01000000ad3b4991ec7d52438797134bcb02a15c0000000002000000000010660000000100002000000029a0dd2613bd7b04b1383c100bd2c30136a3a1c10b4d9110deda0e6c2fdc8203000000000e800000000200002000000091377bbd4b80c3bfa5c8f675a5db95b4ebf970dac04b2c93825057209ef4813e1000000026d47d10fefe37b91a90753e20894f2140000000d403186869d8b0d9171456eb97a1c7fe28b90d6b591e75976c5425d02ba96fa7b58c2c57d275f0a8d18cd88baaca39f415cad49434457119d1830ddf2c5e44f5"
PS C:\encryptedpassword> Write-Host $sessionOptions.Password
abcd