Query Folder tree for Size and export to a log on a server
问题 Im looking to query the my documents folder for size, but also list the subfolders for size and export to a directory. I found some of this online and am trying to tweak to my needs but having issues with the export part, any help is GREATLY appreciated! : $startFolder = "C:\Users" $colItems = (Get-ChildItem $startFolder | Measure-Object -property length -sum) "$startFolder -- " + "{0:N2}" -f ($colItems.sum / 1MB) + " MB" add-content \\server\logs$\DirSize\log.log "$(gc env:computername)"