$grab = get-childitem "C:\Temp" -recurse | where {$_.extension -eq ".txt"} | % { Write-Host $_.FullName }
foreach ($item in $grab) {Copy-Item $item -destination "c:\Find"}
When I run that above script it fails with this error.
Copy-Item : Cannot bind argument to parameter 'Path' because it is null.
If I Remove the $grab = and the foreach line then it works fine and returns all of the .txt files I have in my c:\temp folder.
What did I do wrong?