Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#159 5 comentários 4 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Stack de tecnologia
powershell
Domínio
cli

Direção de pesquisa

Comece pela discussão relacionada na issue #109, especialmente pelo comentário vinculado, para entender os cenários de conversão propostos e o escopo ainda não resolvido. Determine se o trabalho deve abranger ConvertFrom-Hashtable, ConvertTo-PSCustomObject, ConvertTo-Hashtable ou vários cmdlets; a conclusão exigiria um RFC focado, pronto para receber feedback do PowerShell Committee e passar por uma votação.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
PowerShell
Estrelas
468
Forks
143
Merge médio
9min
PRs com merge (30d)
1

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de PowerShell/PowerShell-RFC

Todas as issues de PowerShell/PowerShell-RFC

Issues semelhantes

Mais issues de CLI

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.