unable to get the total file count details from the directory and sub directory.

Advertisement

sbrsb86
Guest

unable to get the total file count details from the directory and sub directory.

$session.ExecuteCommand("ls -l").output

the above mentioned code gives me error.

##Error##
PS F:\abc> $session.ExecuteCommand("ls -l")
Exception calling "ExecuteCommand" with "1" argument(s): "Element session@0 already read
to the end"
At line:1 char:1
+ $session.ExecuteCommand("ls -l")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidOperationException

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,502
Location:
Prague, Czechia

Re: unable to get the total file count details from the directory and sub directory.

Please attach a full session and debug log files showing the problem (using the latest version of WinSCP).

To generate the log files, set Session.SessionLogPath and Session.DebugLogPath. Submit the log with your post as an attachment. You may want to remove and data you consider sensitive, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum