You can use a PowerShell script to get a list of all of the files of particular type in a directory by using the -Include command. In this example, we use the get-childitem command, followed by the path with the source files, followed by the command to include only certain types of files.
get-childitem C:\FooFolder\excels\ -Include *.xls -Recurse
The -Recurse setting causes the script to account for files in subfolders.
If we run a script to set the result to equal a particular value:
$a = get-childitem C:\FooFolder\excels\ -Include *.xls -Recurse
We can use this to generate a count of the number of files that the script finds: