However the formating was a little lacking… When importing, make sure to select “Delimited” in the first page of the wizard and check the “comma” checkbox in the second page.Įxcel loaded the data and I ended up with 412,012 rows (including one row for the header). Just open Excel (I’m using Excel 2016 Preview) and load the CSV file. With the AllFiles.csv file available, we can now load the raw data in Excel and start working with it. Step 3 – Load into Excel and build the right table In my case, it took a few minutes and the resulting file size was 135,359,136 bytes (or around 130MB).
![treesize powershell treesize powershell](https://www.white-windows.ru/wp-content/uploads/2020/12/6160157_1.png)
The resulting file can get quite big as well. That command will take several minutes to run, depending on the number of files on your disk, the speed of the disk and the speed of your computer. Here’s the final command line:ĭir -Recurse -ErrorAction Silentl圜ontinue | Select FullName, Extension, Length, CreationTime, Attributes | ConvertTo-Csv -NoTypeInformation | Out-File C:AllFiles.csv You need to also include something to avoid any permission errors while accessing the data and output the results to a file, so we can load it into Excel. Luckly, PowerShell has a cmdlet to transform data into Comma-Separated Values, also known as CSV. Next, you want to make sure you transform into into a format that Excel can consume. That will make it faster to obtain and will give Excel less data to chew on, which is always a good thing.Here’s what you could use (running as an administrator), to get information:ĭir C: -Recurse | Select FullName, Extension, Length, CreationTime, Attributes Now with possibly hundreds of thousands of files, you want to make sure you gather only the necessary data. Using the Get-ChildItem (more commonly known by its alias: DIR), you can get information about each folder and file on the disk. As you problably already figured out, we’ll use PowerShell to query the file system and extract that data. In any work with PivotTables and BI (Business Inteligence) in general, you need to identify the raw data that you can use to produce the answers to your questions. So the point is that you would use Excel PivotTables to explore the data set and come up with the answers while interacting with it. Given that dataset, you could come up with many, many more.
![treesize powershell treesize powershell](https://cloudsns.files.wordpress.com/2016/08/11.png)
However, those questions are just the tip of the iceberg. It would in itself be a great programming exercise, but some would be quite tricky to code. Now you could write a PowerShell script to answer any of those questions. Which day of the week do you create the most new pictures? Or PowerPoint presentations?.
![treesize powershell treesize powershell](https://windows-cdn.softpedia.com/screenshots/Folder-Tree-Creator_3.png)