07 February 2014

Show Folder Contents As Excel Chart With PowerShell Script

PowerShell iconWhen you are working with a client's files and folders you probably want to discuss the content with him/her, but that is easier if you can visualize and show statistics on the folder content. In a new tutorial I am demonstrating a PowerShell script that lists the folder contents in CSV files.

SharePoint Saturday
Two weeks ago I had a session at the Stockholm SharePoint Saturday event. I talked about my current commission to move thousands of Office files into SharePoint. I have been asked to share my session with a larger audience, and therefore I have begun publishing a series of tutorials about this project in the Tips section.

PowerShell scripts
Before I begun moving the files I converted all Office files with the old formats into the modern Office formats, and that process is described in another blog post in the series. All steps are described in the Tips section, where you also can download the PowerShell scripts I have used in the demos.

Fileshare inventory
The first thing I wanted to discuss with my client was if some of the old files should be deleted or not moved into SharePoint. To visualize and give statistics on the content of their 225 000 directories I created a PowerShell script that loops throught the files in each directory and gives the output of three CSV files: Folders, Files and Permissions.
Folder content Excel chart
Visualize folder contents
When I open the CSV files in Excel I can study the folder contents with all the features of Excel, and I can also make a chart of it. When data is visualized this way, it is often easier to make decisions on what to do with it.

Script explanation
In the demo below I go through my PowerShell script and explains it, so that you can use it as a starting point for your own script. In the Fileshare Inventory Tips article you can download the PowerShell script, and I hope you will find it useful when you need to create statistics out of folder contents!

At least I know that many of the visitors at SharePoint Saturday in Stockholm appreciated my session. I was judged second best of the 21 speakers, and 96 % of the voters gave me happy smileys :-)
SharePoint session poll
By Peter Kalmstrom
CEO and Systems Designer Business Solutions