Noticed some weird behaviour with PowerShell Get-ChildItem. I do something like this in my script:
New-PSDrive -Name "R" -PSProvider "FileSystem"-Root "\\server\share"
$files = Get-ChildItem "R:/" | Select-Object -Property * -ExcludeProperty VersionInfo
$files | export-csv -Path "output.csv" -Delimiter ";"
The Get-ChildItem returns an object with properties such as BaseName, FullName, Parent, Root, ...
The problem I am having is that recently (or on some network shares which I mount) the properties of the object returned by Get-ChildItem changed. It used to be this list:
PSPath PSParentPath PSChildName PSDrive PSProvider PSIsContainer Mode BaseName Target LinkType Name FullName Parent Exists Root Extension CreationTime CreationTimeUtc LastAccessTime LastAccessTimeUtc LastWriteTime LastWriteTimeUtc Attributes
and as of recent (or as mentioned, for certain shared folder, haven't figured that out yet) the following properties were added:
Length DirectoryName Directory
In my CSV I now have 3 extra columns in between Name and IsReadOnly the aforementioned 3 properties are added. Does anyone know if this is due to an update of PowerShell or due to the specific server for which the shared folder was mounted?
-File
parameter on yourGet-Childitem
command. - AdminOfThings