Problem with Copy-Item -force
Posted
by andemt
on Stack Overflow
See other posts from Stack Overflow
or by andemt
Published on 2010-06-10T14:00:21Z
Indexed on
2010/06/10
14:02 UTC
Read the original article
Hit count: 232
power
|powershell-v1.0
Hi,
This is part of my image-copy-script: Get-Childitem | where {$.Extension -eq ".png" -or $.Extension -eq ".gif" -or $_.Extension -eq ".jpg"} | Copy-Item -destination $dest -force
It works fine, and it can overwrite files. Well, it can overwrite if the existing file have attribute R or A. Not when its blanked.
Error in red text: "Copy-Item : The file '\server\d$\path\thumbs\007487l.jpg' already exists."
Why?
© Stack Overflow or respective owner