특정한 날짜 이후로 생성된 파일 확인 및 복사, 그리고 삭제하기


자신의 노트북 컴퓨터 및 서버 컴퓨터에서 특정한 날짜 이후로 생성된 파일을 알아보고, 필요하면 다른 곳으로 복사하고, 마지막으로 삭제까지 할 수 있다.
여기서 각 파일의 LastWriteTime 속성 및 날짜 형식을 이용한다

Get-ChildItem c:\down -Recurse | Where-Object {$_.LastWriteTime -gt “10/29/2017”}

Get-ChildItem c:\down -Recurse | Where-Object {$_.LastWriteTime -gt “10/29/2017”} | Copy-Item -Destination d:\imsi

Get-ChildItem c:\down -Recurse | Where-Object {$_.LastWriteTime -gt “10/29/2017”} | Remove-Item

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s