Skip to content

copy-item does not respect -ErrorAction SilentlyContinue if file is in use #2474

Closed

Description

TFS:7761026

PS C:\Users\ststair> copy c:\windows\system32\cmd.exe
PS C:\Users\ststair> start .\cmd
PS C:\Users\ststair> copy c:\windows\system32\cmd.exe -erroraction SilentlyContinue
copy : The process cannot access the file 'C:\Users\ststair\cmd.exe' because it is being used by another process.
At line:1 char:1
+ copy c:\windows\system32\cmd.exe -erroraction SilentlyContinue
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand

Activity

  1. added
    Up-for-Grabs
    on Oct 25, 2016
  2. removed this from the post-6.0.0 milestone on Oct 25, 2016
  3. JVimes commented on May 1, 2018

    @JVimes

    This bug is a time waster.

  4. SteveL-MSFT commented on May 2, 2018

    @SteveL-MSFT
    MemberAuthor

    John (@JVimes) just to be clear, it's a time waster in that because the bug exists it wastes your time or that it's a waste of time to fix?

  5. JVimes commented on May 2, 2018

    @JVimes

    Oh, yes, it wasted my time as a user (I should have been clearer). I spent time trying everything out I could think of, assuming I was doing something wrong. I think most users are in the same boat.

  6. SteveL-MSFT commented on May 2, 2018

    @SteveL-MSFT
    MemberAuthor

    John (@JVimes) thanks for the clarification. Going to get committee review since this is a breaking change making the currently terminating error into a non-terminating one

  7. added
    Issue-Discussion
    Breaking-Change
    Review - Committee
    on May 2, 2018
  8. JVimes commented on May 2, 2018

    @JVimes

    Thank you so much Steve. Inconsistent or unpredictable behavior is frustrating, and does bad things for the product reputation. I appreciate the effort.

  9. added
    Committee-Reviewed
    and removed
    Review - Committee
    on May 16, 2018
  10. SteveL-MSFT commented on May 16, 2018

    @SteveL-MSFT
    MemberAuthor

    @PowerShell/powershell-committee reviewed this and agree this should be a non-terminating error. We also ask that other *-Item cmdlets be reviewed to see if they have similar issue and all should be consistent.

  11. removed
    Up-for-Grabs
    on May 16, 2018
  12. mi-hol commented on Oct 30, 2019

    @mi-hol

    Steve Lee (@SteveL-MSFT) it seems this issue is falling through the cracks. Any chance this annoying defect could be addressed in version 7, when everybody expects a breaking change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Breaking-ChangeCommittee-ReviewedIssue-DiscussionResolution-FixedWG-Cmdlets

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions