You have two options here. One is to use -Filter parameter in Copy-Item cmdlet if you can do your filtering with the FileSystem filter language. Use also parameter -Recurse if your files can be placed in subdirectories (those subdirectories are copied with their file trees intact). But you cannot use it if you want say first 5 matches.
Example:
Copy-Item -Path "C:\source\Documents\" -Destination "C:\Program Files\target" -ToSession $session -Recurse -Filter "File*.txt"
In the case you need select only first 5 files I would find (using Get-ChildItem cmdlet) them with your criteria first and copy it after that.
You can do something like that (files will be copied to destination without directories)
Using the FileSystem filter language. This code will find your files (only files) in path C:\source\Documents\ filter it by name with wildcard (File*.txt), select first 5 and copy it to destination on remote computer from $session variable
dir "C:\source\Documents\" -Filter "File*.txt" -Recurse -File | select -First 5 | Copy-Item -Destination "C:\Program Files\target" -ToSession $session
Using regex pattern for filtering your files. This code will find your files (only files) in path C:\source\Documents\, filter it by regex pattern (use -match if you want to have it case sensitive) -> FileXXX.txt, where XXX are numbers 0-9, select first 5 files and copy it to destination on remote computer from $session variable
dir "C:\source\Documents\" -Recurse -File | ? {$_.Name -imatch "^File\d{3}.txt$"} | select -First 5 | Copy-Item -Destination "C:\Program Files\target" -ToSession $session
*If you want to copy hidden files, use -Force parameter.
Get-ChildItemto get a list of files. [2] sort them by whatever criteria suits your needs. [3] useSelect-Objectand either the-Firstor the-Lastparameter to grab however many files you want. [grin]