#requires -version 2.0 Param ( [Parameter(Position=0,Mandatory=$True,HelpMessage="Enter a UNC path like \\server\share")] [ValidatePattern({^\\\\\S*\\\S*$})] [ValidateScript({Test-Path -Path $_ })] [string]$Path ) Write-Host "Getting top level folder size for $Path" -ForegroundColor Magenta dir $path | measure-object -Property Length -sum