Skip to content

Conversation

@iSazonov
Copy link
Collaborator

PR Summary

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

PR Context

PR Checklist

@iSazonov 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
@iSazonov iSazonov added this to the 7.1.0-preview.1 milestone Feb 24, 2020
@ghost ghost assigned anmenaga Feb 24, 2020
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Collaborator Author

Choose a reason for hiding this comment

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

Yes, It is was copy-past without fix.

@iSazonov iSazonov force-pushed the catch-ioexc-getfilehash branch from ef07923 to 9fa6d77 Compare March 9, 2020 17:27
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

@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.

@iSazonov
Copy link
Collaborator Author

@daxian-dbw I added new test.

@iSazonov
Copy link
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.

@daxian-dbw
Copy link
Member

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

@daxian-dbw daxian-dbw merged commit 10e7d19 into PowerShell:master Mar 13, 2020
@iSazonov iSazonov deleted the catch-ioexc-getfilehash branch March 13, 2020 16:26
@ghost
Copy link

ghost commented Mar 26, 2020

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

Handy links:

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