Link to home
Start Free TrialLog in
Avatar of sflbuzzman
sflbuzzmanFlag for United States of America

asked on

Powershell file query, sort, output

Have a very basic Powershell request, but my experience is even more basic. Please Humor me...
I need to Write a Windows PowerShell script that will perform the following functions:
1. Search the computer for files ending with a .doc, .docx, .xls, or .xlsx file extension.
2. Output the filenames and sizes (in groups by file extension) to a text file named “File_Summary.txt”.
3. The output should also conclude with a total of the number of files and total file size for each file extension.

Here is as far as I can get:
dir -recurse  -include *.docx, *.xlsx c: | select-object Length, name | sort-Object extension
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sflbuzzman

ASKER

Thanks Subsun. Way more than I anticipated in the setup ... but, just goes to show how much that I have to learn.

Thanks