OK so here is the short and sweet…
$d=get-date -Uformat %Y%m%d
robocopy.exe C:$folder D:$folder /LOG:Log_$folder_$d.txt
For some reason the file name of the log ends up being “Log_20151026.txt”. The folder name does not get included in the log. If I remove the $d (/LOG:Log_$folder.txt). The log will be “Log_TestFolder”. What am I missing here? What needs to be changed so that the log file will be “Log_TestFolder_20151026.txt”?