The WinSCP module currently can't be used with PowerShell 7 as it's bundled with WinSCPnet.dll built for .NET Standard. I'm assuming powershell modules can be built to load different assemblies ...
[WinSCP.SessionOptions]$SessionOptions = New-WinSCPSessionOption -Protocol sftp -HostName $ftpServer -Credential $credential -SshHostKeyFingerprint $sshHostKey ...