Repository navigation
Rewrite Get-FileHash on C# #2731
Description
Activity
BTW, any chance we could add a Get-Hash command as well that would operate on strings instead of files? This comes in handy. See the PSCX impl for Get-Hash as an example. Of course, if I were writing this command from scratch today, I would default to SHA256 instead of MD5. :-)
Reacted by Daniel- addedWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
on Nov 20, 2016 default to SHA256 instead of MD5
I agree but
Is this a breaking change or not?Get-Hashdoesn't exist right now so no worries about a breaking change. And the default Algorithm forGet-FileHashis SHA256. My only point is that it would be nice to have a cmdlet that hashes strings (in addition to the existing cmdlet that operates on files).It is a drag that if you want to hash a string, you have to write it to a file. OK that is not entirely true, you can hash a string directly but not many folks will figure this out:
Get-FileHash -InputStream ([System.IO.MemoryStream]::new([System.Text.Encoding]::ASCII.GetBytes("open sesame")))
Keith Hill (@rkeithhill) Great idea!
So maybe make newGet-Hashcmdlet with support file and string sources and makeGet-FileHashas wrapper for it?Reacted by Keith Hill and DanielPowerShellTeam I started working on this, please assign me.
- removedUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
on Jan 19, 2017
As approved in #2718 Get-FileHash should be rewritten on C#.