Re: Combining include and exclude file masks
The
https://winscp.net/eng/docs/library_session_enumerateremotefiles#mask
With the pipe as a mask separator, you have only hit an edge case of internal mask processing implementation. It should have never worked this way. It's actually a bug.
If you do not want to list subdirectories, replace
mask
argument of Session.EnumerateRemoteFiles
supports only simple Windows wildcards. Not exclusion masks.
https://winscp.net/eng/docs/library_session_enumerateremotefiles#mask
With the pipe as a mask separator, you have only hit an edge case of internal mask processing implementation. It should have never worked this way. It's actually a bug.
If you do not want to list subdirectories, replace
[WinSCP.EnumerationOptions]::AllDirectories
with [WinSCP.EnumerationOptions]::None
.