I need to write the output of cmd command DIR to powershell variable(array). Is it possible? I need it because I use cmd scripting in WinSCP (SFTP client) and when I'm connected to sftp server, I can use cmd commands only, not powershell. But I need to get names and size of files that are in the remote directory to check if the transfer was successful. This is my script which connects to sftp and upload some files:
C:\"Program Files"\WinSCP\winscp.com /console /command "option batch abort" "option confirm off" "open sftp://login:[email protected]" "cd import" "option transfer binary" "put C:\_ZbankyNaOdoslanie\*.gpg" "put C:\_ZbankyNaOdoslanie\*.chk" "close" "exit"
Thank you.