The proper Powershell way would be to instead define formatting instructions based on the output object type - see the docs.Ĭaveats (apply to the linked answer too): Note: Adding properties to the output objects that facilitate friendly display only is done here for implementation convenience only. Size is a number ( ) containing the actual byte count, which is what facilitates further programmatic processing. FriendlySize contains a friendly, auto-scaled string representation of the size, whereas. Sample output from the last command: FullName FriendlySize SizeĬ:\Users\jdoe\Projects 104.07mb 109127742 Get-DirectorySize -Depth 1 -ExcludeSelf | # to smallest, showing only the 5 largest ones: # Get the size of all child directories and sort them by size, from largest # Recursively report the sizes of all subdirectories in the current directory. Sample calls, based on function Get-DirectorySize defined below: # Get the size of the current directory (only).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |