how can i get the length of the full path of a filename?
我成功地在目录结构中递归地获取所有文件,现在我正在尝试获取完整路径的长度:
get-childitem y:\ -rec | where {!$_.PSIsContainer} |
select-object FullName, LastWriteTime, $($_.fullname).length | export-csv -notypeinformation -delimiter '|' -path file.csv
我的问题是$($_.fullname).length
:
Select-Object : Null parameter. Expecting one of the following types: {System.String, System.Management.Automation.Scri ptBlock}. At line:2 char:14
+ select-object <<<< FullName, LastWriteTime, $($_.fullname).length | export-csv -notypeinformation -delimiter '|' -pa th file.csv
+ CategoryInfo : InvalidArgument: (:) [Select-Object], NotSupportedException
+ FullyQualifiedErrorId : DictionaryKeyUnknownType,Microsoft.PowerShell.Commands.SelectObjectCommand
我如何获得文件全名的长度?