Mad With PowerShell: FileInfo and DirectoryInfo objects are not populated upon creation in PowerShell
Posted by jpluimers on 2020/01/16
[WayBack] Mad With PowerShell: FileInfo and DirectoryInfo objects are not populated upon creation in PowerShell.
TL;DR:
- Apart from the
FullName
property, the other poprerties ofFileInfo
andDirectoryInfo
are populated later than their instance creation - A call to their
Refresh
method populates or re-populates them - That method is implicitly called when you request other properties than
FullName
Example: see the [Archive.is]fileinfo.cs: Length property
–jeroen
Leave a Reply