cBrandon Community

General Category => Windows Fixes => Topic started by: branx86 on May 25, 2025, 08:04:16 PM

Title: Power shell move file to different directory with dates
Post by: branx86 on May 25, 2025, 08:04:16 PM
Power Shell commands

$source = "\\TRUENAS\LargeDrive\Satdump Files\Live_IMG"  -Server IP or name   
$source = "D:\videos"  -Drive letter
$destination = "\\TRUENAS\LargeDrive\Satdump Files\Live_IMG"  -Server IP or name
$destination = "C:\video\files"  -Drive letter
$date = Get-Date "01/05/2025"
date needs to before file was created to work.
dir $source | %{ dir $_.FullName | ?{ $_.LastWriteTime -gt $date } | Copy-Item -Destination $destination -Recurse -Force }