7

Quick Script Share - Prompt To Copy File If It Already Exists

 3 years ago
source link: https://thomasrayner.ca/quick-script-share-prompt-to-copy-file-if-it-already-exists/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Quick Script Share - Prompt To Copy File If It Already Exists

By default, Copy-Item will overwrite a file if it exists, unless that file is marked Read Only (in which case you can use the -Force switch to overwrite the file). What if you want to only copy the file if it doesn’t exist, though? What then?

Well, then do this:

Written on November 16, 2016

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK