I am running a command that’s gets all of the .avi files from a path on my computer, i am sorting the output by Length in Descending order and outputting it to a file. What i would like to do is format the returned length property so that is shows in a more manageable format e.g KB/MB/GB. Is there a way to do this?
Get-ChildItem -Path “C:\windows.old\users\user” -recurse -include *.avi -ea 0 | Sort-Object Length -Descending | format-table -Property Name, Directory, Length | out-file “C:\user_Avi.txt”
Sorry if this is basic i am new to Powershell and still learning/not familiar with nest practices.