This PowerShell tool allows you to apply NTFS compression on mass with full visibility of what files are being compressed. The tool runs from a CSV file with at least two columns, “Name” and “Path”. This essentially matches a report exported from Treesize.

Once the script is launched, a progress bar will be displayed at the top of the screen showing how far through the CSV file the script has run, giving an indication of how many files are left to compress. Additionally, the progress bar will show how many files have been successful or errored up to this point.

To pass the CSV file, run .\NTFSCompression.ps1 -CSV pathtofile.csv

By default, only error messages will be displayed. If you would like all messages, pass parameter -AllMsgs

An HTML report will also be generated detailing if any errors occured making it easier to sift through than reading the shell output.

Additionally, since version 1.4, I have introduced a status check script available here. To utilise this script, you must specify a status number when running the script. To do this, add -statusNum 1 when launching this script where 1 is any number. A basic log file will then be created in Logs called ntfscompress-1.log where 1 is the number you selected. The Status Check script will then read this log live and report back the progress. This is useful when running multiple copies of the Mass NTFS Compression Tool, especially on a remote machine.

The script relies on a set of PowerShell Modules called “Carbon”. This is a great package of tools that I highly recommend to anybody automating tasks with PowerShell. To get a copy of “Carbon”, visit http://get-carbon.org/index.html.

I created this script as I had millions of files that required NTFS compression to be applied to them. I had run a report using Treesize Professional, and for whatever reason, whether it be an underperforming server or just the way the software works, it kept freezing up whenever I set it to apply compression. It would compress, but you would have no idea of what the progress was or if it was actually doing anything.

download-icon.273921f460a0c6119fe317a1393d1ce1 Download Mass NTFS Compression Tool v1.2
download-icon.273921f460a0c6119fe317a1393d1ce1 Download NTFSCompress.css Stylesheet for HTML Report


Source Code