Move oldest file to different folder
# Change the -Include file extension to whatever you need. # This example uses .jpg # To ignore file extensions, use this syntax on the first line: # Get-ChildItem -Path c:\path\to\source\folder\* | Get-ChildItem -Path c:\path\to\source\folder\* -Include *.jpg | Sort-Object CreationTime | Select-Object -First 1 | Move-Item -Destination c:\path\to\destination\folder
Comments