Title: Format-Hex: Handle all primitive types & better array input handling by vexx32 · Pull Request #8596 · PowerShell/PowerShell · GitHub
Open Graph Title: Format-Hex: Handle all primitive types & better array input handling by vexx32 · Pull Request #8596 · PowerShell/PowerShell
X Title: Format-Hex: Handle all primitive types & better array input handling by vexx32 · Pull Request #8596 · PowerShell/PowerShell
Description: PR Summary Fixes #3358 Adds support to Format-Hex for any primitive type, along with strings and direct file input. Notes: Renamed class according to standard naming convention FormatHex -> FormatHexCommand Happy to revert if this change is inappropriate, but seemed weird it didn't follow convention -LiteralPath param altered to accept ValueFromPipelineByPropertyName Code borrowed from Jason Shirk (@lzybkr)'s POC in #3358 and repurposed to keep capability to process files and strings Additional code handling jagged arrays and various types of weird inputs that might happen with piped input Test for new behaviours added Behaviour change Cmdlet now treats a homogenous piped input array as a single item, so that pipeline input behaviour should mirror directly presented -InputObject behaviour. In other words, [byte[]](1, 2, 3) | fhx will be treated as a single array and displayed in a single line, instead of being treated as completely separate items. When a similar jagged array is presented, however, the cmdlet will notice and output each pipeline item as a separate display. This should have pretty high consistency in terms of handling string input mixed with other things, as well as just handling jagged input with pretty good consistency with how it would handle standalone input. Enums are supported and will be processed according to their base type (int32 for PowerShell-native enums, all valid base primitives from C#). Kinda fun to work with, now. 😄 PR Checklist PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes Change is not breaking Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header This PR is ready to merge and is not Work in Progress. If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready. User-facing changes Not Applicable OR User-facing Documentation needed Issue filed - Issue link: Testing - New and feature Not Applicable or can only be tested interactively OR Make sure you've added a new test if existing tests do not effectively test the code changed Add [feature] if the change is significant or affects feature tests
Open Graph Description: PR Summary Fixes #3358 Adds support to Format-Hex for any primitive type, along with strings and direct file input. Notes: Renamed class according to standard naming convention FormatHex -> For...
X Description: PR Summary Fixes #3358 Adds support to Format-Hex for any primitive type, along with strings and direct file input. Notes: Renamed class according to standard naming convention FormatHex ->...
Opengraph URL: https://github.com/PowerShell/PowerShell/pull/8596
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:63ff74fd-47df-95bc-900c-1ea95105546d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C084:1C6B09:E4B53:13A42C:6AFD4B3D |
| html-safe-nonce | 210b8dce535c7adba525d934eed27f18ee25cad672fb25325f51dc8b5af15ce6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDg0OjFDNkIwOTpFNEI1MzoxM0E0MkM6NkFGRDRCM0QiLCJ2aXNpdG9yX2lkIjoiNTg5OTU1MDk1NjI3MzM1NTU4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 62e6a36148ba880284b277f17612c6df6ad3865dd3b6e980bcf661afc535a708 |
| hovercard-subject-tag | pull_request:242473789 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/PowerShell/PowerShell/pull/8596/files |
| twitter:image | https://avatars.githubusercontent.com/u/32407840?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/32407840?s=400&v=4 |
| og:image:alt | PR Summary Fixes #3358 Adds support to Format-Hex for any primitive type, along with strings and direct file input. Notes: Renamed class according to standard naming convention FormatHex -> For... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width