I have an SFTP site were files are delivered in a folder, were the folder name would be the previous day date. If its 8th October the folder would be 20201007. After that the files are downloaded, I need to remove the folder with all of its contents.
I configured the below variables in the script
$yesterday = (Get-date).AddDays(-1) $timestamp = $yesterday.ToString("yyyyMMdd")