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:

Leave a Reply

Your email address will not be published. Required fields are marked *