Script: Drive Letter Order

I’m currently writing an application (it’s a huge script – 2100 lines of code) in powershell to automate a weekly VM refresh operation that my team does every Saturday. At the end of the script, I wanted to check the newly deployed virtual machines to verify that the automated scripts did what they were supposed to. One of the items on this checklist is to check the drive letters. For the business owners, the VM has to be setup similar to the source machine. The drive letters have to be setup as follows: C Drive (OS), D Drive (CD Rom), E Drive (Data).

"Click for larger image."

I use VMware’s clone ability to copy the source VM into a template. I use a “CustomizationSpec” to reset the VM’s identifiers and “sysprep” the virtual machine. During the “sysprep” process, the drive letters are reset to: C Drive (OS), D Drive (Data), E Drive (CD Rom). Since this doesn’t meet the customer’s requirement, I created a batch script that is called during the runonce section to change the drive letters. This batch script was placed on the source machine with its’s support files, and is thus carried forward in the clone.

Continue reading “Script: Drive Letter Order”

Script: DOS Menu Batch File

Earlier today, I created a batch file to handle a small delima I was having. I have been assigned a project to build an Application Installation Image (ISO). This ISO will need testing in three different environments (DEV = A, QB = B, PROD = C). The ISO is exactly the same except for the config files. The config files are geared for each individual environment (A, B, & C). In the past, the ISO had to be rebuilt each time for each different environment because the config files had to be included within the Application build. The rebuild process took several hours. Instead of rebuilding the ISO for each individual environment to test in, my co-workers and I decided to build one Golden Image, move all of the config files into a central location, and copy only the needed config files into the application folder (overwriting the ones that were installed from the Golden Image). Once the ISO has been given the green light to be deployed to the company, we would then install the final config files within the final Application ISO build.

Continue reading “Script: DOS Menu Batch File”