Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2020-11-12 to 1 day

Copy-Item doesn't have --no-clobber option

Context: cp(1) has -n or --no-clobber option. It makes cp not overwrite existing files. This option is useful when you copy only newly created files. Problem: In PowerShell, Copy-Item cmdlet doesn't have options equivalent to --no-clobber …