Re: Remove leading path from source files (getfiles, multi-file)
Thank you very much. It works perfectly.
/In
tells WinSCP to download the folder, not its contents only. Use /In/*
.
D:\temp
seems wrong and it should not do what you describe. You should use D:\temp\
.
# Powershell
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"
$remotePath = "/In";
$localPath = "D:\temp";
$removeRemote = $TRUE;
[..]
$transferResult = $session.getfiles($remotePath, $localPath, $removeRemote);