Skip to content
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

Select object for hash table #109

Closed

Conversation

bgshacklett
Copy link

RFC for Extending the Select-Object Cmdlet to facilitate working with Hashtables

@bgshacklett
Copy link
Author

This has been sitting for some time with no action, so I'm guessing I put the document into the wrong folder (The instructions were a bit difficult to understand on that point). I just moved the draft document to the 1-Draft folder.

@joeyaiello
Copy link
Contributor

Finally got around to reviewing this with @PowerShell/powershell-committee.

It sounds like the problem that's being solved here is to convert nested hashtables to PSCustomObjects when the keys are all strings (when they're not strings, conversion will likely result in key collision due to ToString() returning type names).

To that end, we think it's more generically useful to build a ConvertFrom-Hashtable cmdlet that would allow more generic and custom conversion of hashtables to PSCustomObjects and potentially other types using constructors that expect specific hashtable "schemas". Another possible implementation is to do a ConvertTo-PSCustomObject that does more custom handling (and these aren't mutually exclusive). Additionally, a ConvertTo-Hashtable is probably useful.

We don't have this on our radar right now, but if someone wants to give a go at a ConvertFrom-Hashtable RFC and implementation, go for it.

@joeyaiello
Copy link
Contributor

Pending quorum from the rest of the committee for voting.

@joeyaiello
Copy link
Contributor

Still no quorum but we do have a 👍 from @HemantMahawar

@SteveL-MSFT
Copy link
Member

@PowerShell/powershell-committee had quorum and discussed this and agree not to modify select-object specifically for hashtables, but to introduce new cmdlets to make work with hashtables and pscustomobjects

@bgshacklett
Copy link
Author

Shall I just leave this PR open under your control for changes or is it being tracked internally somehow?

@joeyaiello
Copy link
Contributor

To be clear, we believe the correct solution to this scenario is what we described above, but we don't consider it enough of a priority today to write the RFC or implement it ourselves.

To that end, I talked with @daxian-dbw and @SteveL-MSFT about this, we believe the right thing to do here is:

  • reject/close the PR
  • file an issue linking back to this PR and briefly describing our ideal solution
  • mark that issue Up-for-grabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants