GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Windows-PowerShell-Scripts/Image-Auto-Sort-Script at main · Ryan-Adams57/Windows-PowerShell-Scripts

Expand file tree

/

Image-Auto-Sort-Script

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
41 lines (31 loc) · 1.3 KB
/

Image-Auto-Sort-Script

Copy path

File metadata and controls

41 lines (31 loc) · 1.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# ==========================================
# Image Auto-Sort Script (Monthly Cleanup)
# ==========================================
# 1️⃣ Path to folder containing images
# IMPORTANT: Update this path to your actual folder
$sourcePath = "C:\Users\PKUser\Pictures\Screenshots"
# Check if source folder exists
if (-not (Test-Path $sourcePath)) {
Write-Host "Source folder not found: $sourcePath" -ForegroundColor Red
exit 1
}
# Get image files (common formats)
$files = Get-ChildItem -Path $sourcePath -File | Where-Object {
$_.Extension -match "\.(jpg|jpeg|png|heic|webp)$"
}
foreach ($file in $files) {
# 2️⃣ Get month & year from CreationTime
$month = $file.CreationTime.ToString("MM")
$year = $file.CreationTime.Year
$folderName = "$month$year" # Example: 072025
# 3️⃣ Full destination path
$destinationFolder = Join-Path $sourcePath $folderName
# Create folder if it does not exist
if (-not (Test-Path $destinationFolder)) {
New-Item -Path $destinationFolder -ItemType Directory | Out-Null
}
# 4️⃣ Move file
Move-Item -Path $file.FullName -Destination $destinationFolder -Force
Write-Host "Moved: $($file.Name) -> $folderName" -ForegroundColor Cyan
}
Write-Host "Images have been sorted by month successfully." -ForegroundColor Green
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.