I’m using WinSCP PowerShell module from PS Gallery to download file from SFTP Server. I need to throw an error if the file in remote SFTP server is older than 48 hours .
Currently I’m succesfully reading the lastwritetime from remote file and I can get it in format ‘02/23/2018 01:10:44’. Now I need to compare it to current time and throw an error if the file is older than 48 hours. My local time format is a little different (dd.mm.yyyy 00:00:00) than what’s in remote server. Does it matter and do I need to convert them to same format before comparing? Any help would be appreciated.