PowerShellEditorServices: Regression: Most of FileInfo object properties is missing in debug view
Most of FileInfo object properties is missing in debug view comparing to latest stable release of VSC for PowerShell (v2021.10.2)
Only small set of properties is visible:
#inculded in view:
PSPath
PSParentPath
PSChildName
PSDrive
PSProvider
PSIsContainer
Mode
#not included:
VersionInfo
BaseName
Target
LinkType
Name
Length
DirectoryName
Directory
IsReadOnly
Exists
FullName
Extension
CreationTime
CreationTimeUtc
LastAccessTime
LastAccessTimeUtc
LastWriteTime
LastWriteTimeUtc
Attributes
Latest preview version of VSC for PowerShell (v2021.12.0):
VS
Latest stable version of VSC for PowerShell (v2021.10.2):
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 25 (6 by maintainers)
Commits related to this issue
- Regression: Most of FileInfo object properties is missing in debug view Fixes #1649 — committed to PowerShell/PowerShellEditorServices by JustinGrote 2 years ago
So you remember when I said “script properties might blow up though”. Yeah turns out script properties blow up, we need to make sure we’re excluding them. Or marshal back to the pipeline thread to get the value.
I don’t think any workaround is needed in PSES since it was a change in PowerShell itself. It’s not hard to fix it there and even port it back to current LTS version.
I am
@JustinGrote You can use this method on the host to execute an arbitrary C# function within the PowerShell context:
https://github.com/PowerShell/PowerShellEditorServices/blob/149f5ac1089fef8344f8a5849a211a1ba9a88431/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs#L307-L314
@SeeminglyScience excluding them I can do for now, I may need help with the second part. It did blow up on “basename” which is a scriptproperty
Looks like for FileInfo objects specifically a GetValueInvocationException is getting swallowed and causing the silent failure of the remaining properties
As @SeeminglyScience noted in a discussion, it looks like only non-NoteProperties are missing: