I was able to copy all records from a big list to another list but not able to copy specific records form source list to the destination list using PowerShell as below, Any Help Please.
$web = Get-SPWeb $WebURL
$SourceList = $web.Lists[$SourceListName]
$TargetList = $web.Lists[$TargetListName]
$SourceColumns = $sourceList.Fields
#$SourceItems = $SourceList.GetItems();
$souceItems= $SourceList.items | where {$["created"] -gt '1/1/2015' -and $["created"] -lt '1/1/2020'};
$souceItems.Count;
Foreach($SourceItem in $SourceItems)
{ $TargetItem = $TargetList.AddItem()
Foreach($column in $SourceColumns)
{
if($column.ReadOnlyField -eq $False -and $column.InternalName -ne "Attachments")
{
$TargetItem[$($column.InternalName)] = $sourceItem[$($column.InternalName)];
}
}
$TargetItem.Update(); }