-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Catch IOException in Get-FileHash #11944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch IOException in Get-FileHash #11944
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
8000The 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.
There was a problem hiding this comment.
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.
ef07923 to
9fa6d77
Compare
There was a problem hiding this 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.
|
@daxian-dbw I added new test. |
|
Oh, It turns out CI Windows VM redirect pagefile.sys so I have to use WMI to find it in the new test. |
|
Didn't know you can use cim cmdlet for that, very cool :) |
|
🎉 Handy links: |
PR Summary
Fix #11931
Catch all IO exceptions in Get-FileHash cmdlet to do not terminate pipeline.
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.