Add support for deserialized FileSystemInfo objects from PowerShell remoting #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds full support for displaying icons when working with file and folder objects from PowerShell remoting sessions. When users run commands like
Invoke-CommandorEnter-PSSession, objects are deserialized during transmission, changing their type names toDeserialized.System.IO.DirectoryInfoandDeserialized.System.IO.FileInfo. Previously, Terminal-Icons did not handle these deserialized objects correctly.Problem
When using Terminal-Icons with remote PowerShell sessions, users encountered issues because:
[IO.FileSystemInfo]typeSolution
This PR implements comprehensive support for deserialized objects through:
Resolve-IconTest-DeserializedFileSystemInfofor detecting deserialized objectsChanges Made
Modified Files
Terminal-Icons.format.ps1xml- Added deserialized type names to SelectionSetTerminal-Icons/Private/Resolve-Icon.ps1- Safe property access for all FileSystemInfo propertiesTerminal-Icons/Public/Format-TerminalIcons.ps1- Updated parameter validation and help textREADME.md- Added "PowerShell Remoting Support" section with examplestests/unit/Format-TerminalIcons.tests.ps1- Added 6 tests for deserialized objectsNew Files
Terminal-Icons/Private/Test-DeserializedFileSystemInfo.ps1- Helper function for detectiontests/unit/Test-DeserializedFileSystemInfo.tests.ps1- 8 new unit testsTesting
Unit Tests
All existing tests pass, plus 14 new tests specifically for remoting scenarios:
Manual Testing
Test with actual PowerShell remoting:
Backward Compatibility
✅ All changes are fully backward compatible
✅ Existing functionality for local files preserved
✅ No breaking changes to public APIs
✅ All existing tests continue to pass
Checklist
🤖 Generated with Claude Code