FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Catch IOException in Get-FileHash by iSazonov · Pull Request #11944 · PowerShell/PowerShell · GitHub

Catch IOException in Get-FileHash - #11944

Merged
Dongbo Wang (daxian-dbw) merged 6 commits into
PowerShell:masterfrom
iSazonov:catch-ioexc-getfilehash
Mar 13, 2020
Merged

Catch IOException in Get-FileHash#11944
Dongbo Wang (daxian-dbw) merged 6 commits into
PowerShell:masterfrom
iSazonov:catch-ioexc-getfilehash

Conversation

Copy link
Copy Markdown
Collaborator

PR Summary

Fix #11931
Catch all IO exceptions in Get-FileHash cmdlet to do not terminate pipeline.

PR Context

PR Checklist

Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Feb 24, 2020
Ilya (iSazonov) added this to the 7.1.0-preview.1 milestone Feb 24, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should be WriteError() too - as in the original WinPS implementation, any exception for a given pipeline input should be a non-terminating error.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes, It is was copy-past without fix.

Ilya (iSazonov) force-pushed the catch-ioexc-getfilehash branch from ef07923 to 9fa6d77 Compare March 9, 2020 17:27

Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ilya (@iSazonov) You can use the special .sys file on the system drive of a windows OS for the test, for example, pagefile.sys or swapfile.sys.

Copy link
Copy Markdown
Collaborator Author

Dongbo Wang (@daxian-dbw) I added new test.

Copy link
Copy Markdown
Collaborator Author

Oh, It turns out CI Windows VM redirect pagefile.sys so I have to use WMI to find it in the new test.

Copy link
Copy Markdown
Member

Didn't know you can use cim cmdlet for that, very cool :)
LGTM.

Dongbo Wang (daxian-dbw) merged commit 10e7d19 into PowerShell:master Mar 13, 2020
Ilya (iSazonov) deleted the catch-ioexc-getfilehash branch March 13, 2020 16:26

Copy link
Copy Markdown

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Get-FileHash Terminates at Corrupt File

5 participants


Back | FazBrowse Home | New Git URL