<# PowerShell script to calculate the number of given file name extensions in selected folder #> $Path = Read-Host "Input Folder FulName [Location and Name]" $ex = Read-Host "Input Extension [example .txt ]" $count=0 Get-ChildItem -Path $Path | ForEach-Object { if ( $_.Extension -eq $ex ) { $count++ } } Write-Host("Number of files that have extension", $ex , "=" , $count) Sleep(20)