# ExtensionReport.ps1 # Keywords: Get-ChildItem, file extensions, Group-Object # Jeffery Hicks # This script will prompt you for a directory name and then display a list of # all file extensions sorted and grouped. As written the script will # recurse through all subfolders. [string]$dir=Read-Host "What directory do you want to start in?" Write-Host "File report for "$dir.ToUpper() get-childitem -path $dir -recurse|where {$_.Gettype().name -eq "FileInfo"} |group-object extension -noelement|sort count -desc