Posts

Showing posts with the label powershell

PowerShell: Simple task for finding top sized folders

First save the PS script Get-DirStats.ps1 Source Code of Get-DirStats.ps1 # Get-DirStats.ps1 # Written by Bill Stewart # Outputs file system directory statistics. #requires -version 2 <# .SYNOPSIS Outputs file system directory statistics. .DESCRIPTION Outputs file system directory statistics (number of files and the sum of all file sizes) for one or more directories. .PARAMETER Path Specifies a path to one or more file system directories. Wildcards are not permitted. The default path is the current directory (.). .PARAMETER LiteralPath Specifies a path to one or more file system directories. Unlike Path, the value of LiteralPath is used exactly as it is typed. .PARAMETER Only Outputs statistics for a directory but not any of its subdirectories. .PARAMETER Every Outputs statistics for every directory in the specified path instead of only the first level of directories. .PARAMETER FormatNumbers Formats numbers in the output object to include thousands separators. .PA...