How to loop through files (full path) in PowerShell

powershell

Solution

I'm not sure what mtime does here is the code to do everything else

gci -re -in *.txt "some\path\to\search" | 
  ?{ -not $_.PSIsContainer } |
  %{ mv $_.FullName "$($_.FullName).old" }

Problem

How do I do the equivalent in PowerShell? Note that I require the full path to each file. ``` # ksh for f in $(find /app/foo -type f -name "*.txt" -mtime +7); do mv ${f} ${f}.old done ``` I played around with Get-ChildItem for a bit and I am sure the answer is there someplace.

Original source

Related problems