windows - how to display the length of a FULLNAME -
how can length of full path of filename?
i getting files recursively in directory structure succesfully, , trying length of fullpath:
get-childitem y:\ -rec | {!$_.psiscontainer} | select-object fullname, lastwritetime, $($_.fullname).length | export-csv -notypeinformation -delimiter '|' -path file.csv
my issue this: $($_.fullname).length
:
select-object : null parameter. expecting 1 of following types: {system.string, system.management.automation.scri ptblock}. @ 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
how length of fullname of file?
create custom expression in select cmdlet. this:
get-childitem y:\ -rec | {!$_.psiscontainer} | select-object fullname, lastwritetime, @{n="fullnamelength";e={ $_.fullname.length }} | export-csv -notypeinformation -delimiter '|' -path file.csv
n
= name , e
= expression. can use full name. l
or label
alternative name
. no mather way write them, end custom property. : )
Comments
Post a Comment