Hi, Im new to powershell and need a little help in finalising my script, I want to move files from 2 different locations and move them to destinations into a folder which will be named with the current date. :
Here is the script so far.... (It just does a straight copy from one place to another)
$src = "H:\testing\pickup"
$dst = 'H:\testing\destination'
Get-ChildItem $src -Filter "IDITLog*" -Recurse | % {
#Creates an empty file at the destination to make sure that subfolders exists
New-Item -Path $_.FullName.Replace($src,$dst) -ItemType File -Force
copy -Path $_.FullName -Destination $_.FullName.Replace($src,$dst) -Force }
$src = "H:\testing\pickup2"
$dst = 'H:\testing\destination2'
Get-ChildItem $src -Filter "IDITLog*" -Recurse | % {
#Creates an empty file at the destination to make sure that subfolders exists
New-Item -Path $_.FullName.Replace($src,$dst) -ItemType File -Force
copy-Item -Path $_.FullName -Destination $_.FullName.Replace($src,$dst) -Force }
Can anyone help please...