Skip to content

handle IO Exception as non-terminating - #10950

Merged
Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:copy-item-inuse
Nov 1, 2019
Merged

Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:copy-item-inuse

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 30, 2019 •

Copy link
Copy Markdown
Member

PR Summary

FileSystemProvider CopyItem was only handling UnauthorizedAccessException. However, if a file is in use and can't be overwritten it's an IOException which is then unhandled and stops a recursive copy. Fix is to catch IOException and emit an ErrorRecord and continue.

PR Context

Fix #2474

PR Checklist

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Oct 30, 2019
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit a3d73d7 into PowerShell:master Nov 1, 2019
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 1, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the copy-item-inuse branch November 1, 2019 17:19
@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

@unfurl-links unfurl-links Bot mentioned this pull request Mar 27, 2024
5 tasks done
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants