Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

unannunciated

How can I check for an empty remote folder using powershell

I currently implemented "check if folder is empty" like this :
$dir = $session.listdirectory("/download/new")        
if ( $($dir.files).count -gt 1 ) {

What I dislike about it is that I have to test for "1", even though the remote dir "/download/new" is empty.

thx