jdhitsolutions / PSScriptTools

:wrench: :hammer: A set of PowerShell functions you might use to enhance your own functions and scripts or to facilitate working in the console. Most should work in both Windows PowerShell and PowerShell 7, even cross-platform. Any operating system limitations should be handled on a per command basis. The Samples folder contains demonstration script files
MIT License
875 stars 110 forks source link

Column heading with "/" fails to display values in the grid #108

Closed JakeK-MBIA closed 3 years ago

JakeK-MBIA commented 3 years ago

Given a simple object:

$myObject = [PSCustomObject]@{ Name = 'Kevin' 'blah/2' = 'PowerShell' State = 'Texas' }

$myObject | ConvertTo-WPFGrid

Column values with forward slash "/" fails to show in the grid.

image

PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Microsoft Windows 10.0.19042 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

jdhitsolutions commented 3 years ago

I suppose technically using a slash is legal. But definitely non-standard. I'll have to dig into this.

jdhitsolutions commented 3 years ago

This is a problem with autogenerated columns as I am doing with this command. https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f5f752f6-f08d-4d46-9e1e-78a4496eaf12/why-does-not-datagrid-show-values-if-there-are-a-point-82208221-or-82208221-in-header?forum=wpf Modifying the code to meet this edge case may require more work than is justified. But I will look.

jdhitsolutions commented 3 years ago

I think I have an updated version for the next release that will fix this. Until then, avoid using slashes or periods.

JakeK-MBIA commented 3 years ago

That is awesome! Thanks so much for your work and effort. Big fan!

jdhitsolutions commented 3 years ago

Update the module to v2.37.0 and this should fix the problem.

JakeK-MBIA commented 3 years ago

Very nicely done. It works now. Thank you very much.

image