I'm trying to move all pictures over a definable date to a certain folder.
Here's my script so far -
##Archive files that are older than a certain date $date = "01/12/2013" [array]$OldestFileImport = get-childitem "*.jpg" | where-object {$_.LastWriteTime -le [datetime]::$date} ##$OldestFileImport.count move-item $OldestFileImport -Destination "C:\users\USER NAME\pictures"
I have copied elements of that, as I'm not really sure why / when you're meant to use variables that have the $_Text format rather than the $Text... I don't really get that.
Apparently the path created by this is null... But I don't really know why.
cheers!