PowerShell / PowerShell/PowerShell-RFC
ConvertFrom/To-Hashtable and/or ConvertTo-PSCustomObject cmdlets
Personne n'a encore pris cette issue.
- Langage dominant
- PowerShell
- Étoiles
- 467
- Forks
- 140
- Merge moyen
- 9 min
- PR mergées (30 j)
- 1
Description
Related discussion in #109, specifically this comment:
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.
We think the scenario we're trying to address is primarily casting nested hashtables of hashtables into PSCustomObjects (or possibly even other types).
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la discussion associée dans l’issue #109, en particulier le commentaire lié, afin de comprendre les scénarios de conversion proposés et le périmètre encore indéfini. Déterminez si le travail doit couvrir ConvertFrom-Hashtable, ConvertTo-PSCustomObject, ConvertTo-Hashtable ou plusieurs cmdlets ; l’achèvement nécessiterait un RFC ciblé, prêt à être soumis aux retours du PowerShell Committee et à un vote.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- powershell
- Domaine
- cli
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100