Created
October 31, 2018 14:34
-
-
Save bohack/388bd03260c3b73f82d05f499a0e1be7 to your computer and use it in GitHub Desktop.
PowerShell to Read the Folders Information (Profile Cleanup)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem y:\ | ForEach-Object { | |
Get-ChildItem y:\$_ | ForEach-Object { | |
$Size = "{0:N2} MB" -f ((Get-ChildItem $_.fullname -Recurse | Measure-Object -Property Length -Sum).Sum / 1MB) | |
$Out = $_.FullName + "," + $_.LastWriteTime + "," + $Size + "," + $_ | |
Write-Host $Out | |
Out-File -Append -InputObject $Out -FilePath .\output.csv -Encoding ascii | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment