PowerShell is object oriented, not pure text, such as cmd . If you want to get file objects (lines) that were changed in 2012, use:
Get-ChildItem | Where-Object { $_.LastWriteTime.Year -eq 2012 }
If you want to get file files with "2012" in the file name, try:
Get-ChildItem *2012*
When you use
ls | select-string 2012
you are actually looking for lines with "2012" INSIDE for each file that is specified by ls / get-childitem .
If you really need to use select-string to output from get-childitem , try converting it to strings, then split into strings and then do a search. Like this:
(Get-ChildItem | Out-String) -split "`n" | Select-String 2012
source share