Answered by:
Script to copy new files to another folder and then delete original file

Question
-
Hello, I am looking for a script that will copy only new files from one folder to another. Also, I would like the original file to automatically be deleted. Thank you in advance!
- Edited by B00GS Wednesday, April 18, 2018 6:06 PM
Wednesday, April 18, 2018 6:05 PM
Answers
-
It's called 'move', this will copy to new location and then delete from source
Get-ChildItem <location> | where { $_.CreationTime -eq (Get-Date -f "MM/dd/yyyy") } | Move-Item <destination>
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''
Wednesday, April 18, 2018 6:11 PM
All replies
-
Please carefully review the following links to set your expectation for posting in technical forums.
This Forum is for Scripting Question Rather than script requests
Script requests
PowerShell DocumentationFrom a Bill Stewart summary of useful forum links:
- Posting guidelines
- Handy tips for posting to this forum
- How to ask questions in a technical forum
- Rubber duck problem solving
- How to write a bad forum post
- Help Vampires: A Spotter's Guide
- This forum is for scripting questions rather than script requests
\_(ツ)_/
Wednesday, April 18, 2018 6:11 PM -
It's called 'move', this will copy to new location and then delete from source
Get-ChildItem <location> | where { $_.CreationTime -eq (Get-Date -f "MM/dd/yyyy") } | Move-Item <destination>
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''
Wednesday, April 18, 2018 6:11 PM -
My apologies. I'll be sure to read the rules. Thank you.Wednesday, April 18, 2018 7:05 PM
-
Thank you for your response!Wednesday, April 18, 2018 7:06 PM