Attempting to copy some files from a local server to a network resource, as shown in the images below:
Folder 1

Folder 2

I need to copy the entire contents of the ROOT folder to the SOURCE folder in DESTINATION. But every time he copies the content, I would like him to create a new folder with the same destination folder name, but with some sequential numbering. The number of folders and files in the SOURCE / ROOT folder always remains unchanged (2 folders and 2 files). I just need all the source materials to end up in a new folder at the destination every time I run the script. Here is an example script that I tested, but it just doesn't do what I need:
$date = Get-Date -format MMMM-dd-yyyy
$date2 = Get-Date -format yyyyMMdd
$Source = "C:\SOURCE\ROOT"
$Destination1 = "\\netshare\DESTINATION\DATA_May-26-2014"
$Destination2 = "\\netshare\DESTINATION\DATA_May-26-2014-1st"
$Destination3 = "\\netshare\DESTINATION\DATA_May-26-2014-2nd"
$Destination4 = "\\netshare\DESTINATION\DATA_May-26-2014-3rd"
$Destination5 = "\\netshare\DESTINATION\DATA_May-26-2014-4th"
$Destination6 = "\\netshare\DESTINATION\DATA_May-26-2014-5th"
if (Test-Path $Destination1)
{
robocopy $Source $Destination2 /MIR /Z /E /fft /MAXAGE:$date2
}
if (Test-Path $Destination2)
{
robocopy $Source $Destination3 /MIR /Z /E /fft /MAXAGE:$date2
}
if (Test-Path $Destination3)
{
robocopy $Source $Destination4 /MIR /Z /E /fft /MAXAGE:$date2
}
if (Test-Path $Destination4)
{
robocopy $Source $Destination5 /MIR /Z /E /fft /MAXAGE:$date2
}
if (Test-Path $Destination5)
{
robocopy $Source $Destination6 /MIR /Z /E /fft /MAXAGE:$date2
}
else
{
robocopy $Source $Destination1 /MIR /Z /E /fft /MAXAGE:$date2
}
robocopy , ( ), robocopy, powershell script robocopy.
, script?