PowerShell / PowerShell/PowerShell
$PSVersionTable does not correctly implement ToString, causing issues with Set-Clipboard
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 55.5k
- Forks
- 8.5k
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 88
Descripción
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Since #18116 has been implemented, I have tried to use it when filling out issues on my remote setup, but I need to pipe it via Out-String for it to work properly. This seems to be caused by it not implementing ToString() correctly, instead relying on formatters to display its information.
Expected behavior
> $PSVersionTable | Set-Clipboard
> Get-Clipboard # Ctrl+Shift+V
Name Value
---- -----
PSVersion 7.4.0-preview.4
PSEdition Core
GitCommitId 7.4.0-preview.4
OS Ubuntu 22.04.2 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Actual behavior
> $PSVersionTable | Set-Clipboard
> Get-Clipboard
System.Management.Automation.PSVersionHashTable
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.4.0-preview.4
PSEdition Core
GitCommitId 7.4.0-preview.4
OS Ubuntu 22.04.2 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza reproduciendo el pipeline reportado con $PSVersionTable, Set-Clipboard y Get-Clipboard; después, rastrea el tipo PSVersionHashTable y su comportamiento al convertirlo en una cadena. El trabajo estará terminado cuando canalizar $PSVersionTable directamente a Set-Clipboard produzca la salida formateada de nombres y valores mostrada bajo Expected behavior, sin requerir Out-String.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, powershell
- Área
- cli
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100