Added Get-FileEncoding cmdlet - #20586
Armaan Mcleod (ArmaanMcleod) wants to merge 8 commits into
Conversation
|
The issue predates the TextUtility module. I feel this cmdlet should be in that module so earlier PowerShell versions can make use of it. |
| /// <summary> | ||
| /// This class implements the Get-FileEncoding command. | ||
| /// </summary> | ||
| [Cmdlet(VerbsCommon.Get, "FileEncoding", DefaultParameterSetName = PathParameterSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkID=1234567")] |
There was a problem hiding this comment.
We need new link.
There was a problem hiding this comment.
Yeah put this one as a placeholder. I will also fill out documentation issue.
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
@PowerShell/wg-powershell-cmdlets discussed this and we agreed that this is a useful cmdlet, however, it should be part of the https://github.com/powershell/textutility module and not part of PS7 itself.
|
|
Thanks Steve Lee (@SteveL-MSFT) & Thomas Nieto (@ThomasNieto) for the feedback. I'll make a PR in the TextUtility repo and close this PR. |
|
📣 Hey Armaan Mcleod (@ArmaanMcleod), how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://forms.office.com/r/P926k48jRJ |
PR Summary
Fixes #2290.
Added
Get-FileEncodingcmdlet to detect encoding from file usingSystem.IO.StreamReader.CurrentEncoding.Also moved the
GetPathEncodingmethod toPathUtilsso it can be shared easily between cmdlets.PR Context
Parameter Sets
Usage
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.(which runs in a different PS Host).