$count = 1 Get-ChildItem -Path 'C:\Users\Jay Jones\Desktop\Screenshots\phase1\*' -Include *.jpg,*.png -File | Sort-Object CreationTime | Rename-Item -NewName { 'ngimg-{0:D4}{1}' -f $script:count++, $_.Extension }