Skip to content

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

@SteveL-MSFT

Description

@SteveL-MSFT

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

Metadata

Metadata

Assignees

Labels

Breaking-Changebreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions