Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell Move Folders from Source to Target

$
0
0

This is what I have, but I need to move subfolders of the source to the destination also. There could also be subfolders of subfolders. Any idea? Right now it only moves files in the root folder Users

Powershell
do{$date=Read-host"Enter date (MM/DD/YYYY) : "}while($date-as[datetime]-isnot[datetime])$date=$date-as[datetime]$date$path="C:\temp\Users\*"$destination="c:\temp2\Users\*"Foreach($filein(Get-ChildItem$path)){If($file.LastWriteTime-gt$date.date){if(!(Test-path(join-path$destination$file.name))){Copy-Item-Path$file.fullname-Destination$destination}}}

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>