Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

Test-SFTPPath and Get-SFTPChildItem not seeing directories created after first use.

Open Chris4678 opened this issue 6 years ago • 1 comments

I have a script that is constantly looping and a part of the loop is to do a test-sftpPath for a specific folder. If that folder exists it triggers an if statement. This works fine the first run through, however, if I create the folder it is checking for while the script is still running it wont show in get-sftpchilditem or test-sftppath until you use the module to update some other file in the directory or start a new sftp session.

Chris4678 avatar Jan 31 '20 22:01 Chris4678

What is the target server ? It could be caching the information

Sent from my iPhone

On Jan 31, 2020, at 6:03 PM, Chris4678 [email protected] wrote:

 I have a script that is constantly looping and a part of the loop is to do a test-sftpPath for a specific folder. If that folder exists it triggers an if statement. This works fine the first run through, however, if I create the folder it is checking for while the script is still running it wont show in get-sftpchilditem or test-sftppath until you use the module to update some other file in the directory or start a new sftp session.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

darkoperator avatar Jan 31 '20 23:01 darkoperator