Skip to main content

Searching

To search a folder and subfolders for a wildcard word and aggregate to a  single folder. (THIS MOVES FILES) 

 

Get-ChildItem "C:\LTShare\Uploads\*latestspeedtestresults.txt" -Recurse | Move-Item -Destination "DestinationFolder" -Force 

 

 

To search a folder and subfolders for a wildcard word and aggregate to a  single folder. (THIS COPIES FILES) 

 

Get-ChildItem "C:\LTShare\Uploads\*latestspeedtestresults.txt" -Recurse | Copy-Item -Destination "DestinationFolder" -Force 

 

To Search a folder and subfolders and display the 10 most recently edited files 

 

Dir D:\folder -r | ? {! $_.PSIsContainer} | sort LastWriteTime | select -last 10