Thread: Copy-Item
View Single Post
Old 05-03-2007   #4 (permalink)
Keith Hill [MVP]


 
 

Re: Copy-Item

"JW" <JW@discussions.microsoft.com> wrote in message
news:530C457C-4110-44CC-A556-F1B7B045E2B9@microsoft.com...
> Well on my system it does. According to the documentation the -force
> switch
> only:
>
> "Allows cmdlet to override restrictions such as renaming existing files as
> long as security is not compromised"
>
> Which is in my opinion needed when attributes like 'hidden' etc. are
> specified.
>
> The command:
>
> Copy-Item C:\test.txt -Destination C:\test\
>
> happily copies test.txt into the C:\test directory clobbering the
> exsisting
> test.txt already present in C:\test


Yeah I see the same behavior. It is Move-Item that requires -force to
overwrite a file. Seems a bit inconsistent that Copy-Item doesn't behave
the same way IMO.

--
Keith


My System SpecsSystem Spec