PowerShell / ConsoleGuiTools

Modules that mix PowerShell and GUIs/CUIs!
https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools
MIT License
776 stars 59 forks source link

Verbose output produces base64 encoded text #192

Closed mavaddat closed 10 months ago

mavaddat commented 1 year ago

Prerequisites

Steps to reproduce

Specifying -Verbose on Out-ConsoleGridView produces base64-encoded strings like:

VERBOSE: TW9kZSRfLiJNb2RlV2l0aG91dEhhcmRMaW5rIg==
VERBOSE: TGFzdFdyaXRlVGltZSRfLiJMYXN0V3JpdGVUaW1lU3RyaW5nIg==
VERBOSE: TGVuZ3RoJF8uIkxlbmd0aFN0cmluZyI=
VERBOSE: TmFtZSRfLiJOYW1lU3RyaW5nIg==

Culprit TypeGetter.cs#LL172C1

Decoding these produces:

'TW9kZSRfLiJNb2RlV2l0aG91dEhhcmRMaW5rIg==', 'TGFzdFdyaXRlVGltZSRfLiJMYXN0V3JpdGVUaW1lU3RyaW5nIg==', 'TmFtZSRfLiJOYW1lU3RyaW5nIg==' | ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) }
$ Mode$_."ModeWithoutHardLink"
$ LastWriteTime$_."LastWriteTimeString"
$ Name$_."NameString"

Expected behavior

Verbose output should help the user track the behaviour of the cmdlet and diagnose any potential problems.

Actual behavior

The user must decode the verbose output.

Error details

No response

Environment data

GitCommitIdPSRemotingProtocolVersionPSVersionPlatformSerializationVersionPSEditionOSWSManStackVersionPSCompatibleVersions
7.3.42.37.3.4Win32NT1.1.0.1CoreMicrosoft Windows 10.0.190443.0
MajorMinorBuildRevisionMajorRevisionMinorRevision
10-1-1-1-1
20-1-1-1-1
30-1-1-1-1
40-1-1-1-1
50-1-1-1-1
5110032000
600-1-1-1
610-1-1-1
620-1-1-1
700-1-1-1
710-1-1-1
720-1-1-1
734-1-1-1

Version

0.7.2

Visuals

No response

tig commented 1 year ago

Hmmm... I'm not sure what folks would expect to see with -Verbose. Fixing the "culprit" to emit the Column name seems unsatisfactory:

image

A quick fix is to just remove this code. A bigger fix is to figure out what the right stuff to emit on -Verbose is.

@maxaddat, what would you expect to see?