Thank you very much. It works perfectly.
/Intells WinSCP to download the folder, not its contents only. Use
D:\tempseems wrong and it should not do what you describe. You should use
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"
$remotePath = "/In";
$localPath = "D:\temp";
$removeRemote = $TRUE;
$transferResult = $session.getfiles($remotePath, $localPath, $removeRemote);