Re: Upload file if exists (filename changes daily)
You cannot use
Use
See https://winscp.net/eng/docs/script_checking_file_existence#local
Though it makes no sense anyway. You do not want to test if a file exist, you want to test if
Session.FileExists
to test for an existence of a local file.
Use
Test-Path
cmdlet instead.
See https://winscp.net/eng/docs/script_checking_file_existence#local
Though it makes no sense anyway. You do not want to test if a file exist, you want to test if
Get-ChildItem
returned any file. So just do:
if ($localFile) {
...
}