How can I check for an empty remote folder using powershell

Advertisement

unannunciated
Joined:
Posts:
1

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

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum