Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Powershell script to move files in folders and subfolders from one Network location to the local server (X Days old)

$
0
0

I am trying to use to below Powershell script:

get-childitem -Path \\servername\location |
    where-object {$_.LastWriteTime -lt (get-date).AddDays(-31)} |
    move-item -destination "C:\Dumps"

The script works absolutely fine on testing but its not moving the files in subfolders.

Please help....


Viewing all articles
Browse latest Browse all 10624

Trending Articles