Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Foreach – filecopy script help.

$
0
0

Hi,

I got it to work using the script below. Do you foresee any issue from doing it this way?


foreach ($a in Get-ChildItem C:\Output_logs_from_tests)
{
if ($a.CreationTime -lt ($(Get-Date).Adddays(-1)))
{
move-Item $a.FullName C:\testfolder
}
}

Thanks.


Viewing all articles
Browse latest Browse all 13067

Trending Articles