Here's what I'm trying to accomplish
- run sql query - result output to txt file
- results of txt file to array
- get child item- folders and files in the directory if the folder name matches a value from the array
- copy items that are returned in step 3 to another directory
The problem I am having is filtering the items in the directory based on the values of the array
gci $sourcepath -recurse | where {$_.name -like $idlist} | Copy-Item -Destination $DestinationHistoryPath
$idlist? Please provide a minimal reproducible example.-incomparison?