Terminal-Icons icon indicating copy to clipboard operation
Terminal-Icons copied to clipboard

[Feature] - Support Deserialized.System.IO.FileInfo

Open mattcargile opened this issue 4 years ago • 2 comments

Expected Behavior

Output icons and colorization after running Invoke-Command -ComputerName . -ScriptBlock { Get-ChildItem }

Current Behavior

Current behavior is empty data.

Possible Solution

Edit Format-TerminalIcons and Resolve-Icon to support Deserialized.System.IO.FileInfo

Context

I'd like to have the colorization when running Invoke-Command

Workaround

I added if ( $_.psobject.TypeNames -like 'Deserialized*' ) {$_.Name} else { Terminal-Icons\Format-TerminalIcons $_ } to my ps1xml file.

Your Environment

  • Module version used: 0.5.2
  • Operating System and PowerShell version: Windows 10; Powershell 7.2.1

mattcargile avatar Dec 28 '21 20:12 mattcargile

Would you be open, @devblackops , to me writing the feature? Something like accepting System.Object within the aforementioned functions and then having an if block or the like to ensure only the native FileInfo/DirectoryInfo and Deserialized versions pass through?

Or maybe use ValidateScript or have two separate parameters with parameter sets.

mattcargile avatar Jan 03 '22 18:01 mattcargile

@mattcargile PRs are welcome!

devblackops avatar Jun 09 '22 05:06 devblackops