Hi to everyone,
To begin, you have to download the YUI Compressor on their official homepage. (The script was tested with the version yuicompressor-2.4.2). Afterwards, you only need to use the script below and adapt it a little bit to your needs:
The first three lines are intended for basic configuration. Line one is the path of the java.exe on your system. Line two is the directory that is recursively scanned for CSS and JS files. The third line is the path of the current yuicompressor. Change these lines to your configuration needs.
The rest of the script is only getting all childitems with the .js and .css extention and executes on each of them the yuicompressor jar by using the “&” command.
This script is handy if you have a lot of file to minimize and don’t want to waste your time in creating your own batch or PowerShell script.
Hope this helps,