Resolved
I've spent some time getting to grips with the .NET assembly, and am now past the first hurdle of connecting, so I think I'll just proceed with that for now 👍
& 'C:\Program Files (x86)\WinSCP\WinSCP.exe' /log="C:\Users\username\WinSCP.log" scp://username:password@hostname /command 'put ""C:\Users\username\OneDrive - CompanyName\Documents\Scripts\PowerShell\Certificates\hostname\hostname-pfxpassword.txt"" /users/home/username/' "exit"
. 2023-02-08 10:46:44.495 File: "\\C:\Users\username\OneDrive"
* 2023-02-08 10:46:44.496 (EOSError) System Error. Code: 123.
* 2023-02-08 10:46:44.496 The filename, directory name, or volume label syntax is incorrect
. 2023-02-08 10:46:44.496 Asking user:
. 2023-02-08 10:46:44.496 File or folder '\\C:\Users\username\OneDrive' does not exist. ("System Error. Code: 123.
. 2023-02-08 10:46:44.496 The filename, directory name, or volume label syntax is incorrect")
< 2023-02-08 10:46:44.496 Script: File or folder '\\C:\Users\username\OneDrive' does not exist.
< 2023-02-08 10:46:44.496 Script: System Error. Code: 123.
< 2023-02-08 10:46:44.496 The filename, directory name, or volume label syntax is incorrect
. 2023-02-08 10:46:44.496 Answer: Abort