ConvertFrom/To-Hashtable and/or ConvertTo-PSCustomObject cmdlets

Aperta
#159 5 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
powershell
Ambito
cli

Direzione di ricerca

Inizia dalla discussione correlata nell’issue #109, in particolare dal commento collegato, per comprendere gli scenari di conversione proposti e l’ambito ancora irrisolto. Determina se il lavoro debba coprire ConvertFrom-Hashtable, ConvertTo-PSCustomObject, ConvertTo-Hashtable o più cmdlet; per considerarlo completato sarebbe necessario un RFC mirato, pronto per il feedback del PowerShell Committee e per una votazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Up-for-Grabs

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).

Lingua principale
PowerShell
Stelle
468
Fork
143
Merge medio
9m
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PowerShell-RFC

Tutte le issue di PowerShell/PowerShell-RFC

Issue simili

Altre issue su CLI

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.