Scoring the VCAP Test Track

This post was last updated on February 21st, 2014 at 09:00 pm

I mentioned last time discussing Test Track that on my “to-do” list was enabling Test Track participants to grade themselves.  Frank B on Twitter suggested publicizing the scoring scripts so here’s the first one.

Now all I need is the spare time to write the other 15.

#Connect to vCenter with passthrough credentials
connect-vi vc-troy-a.cert.vmeduc.com

#load windows piece for popups 'cause I still use PS2
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

#reset variables 
$VM3=0 
$VM3Snapshot = 0 
$VM3DevApp1 = 0
$VM3DevApp2 = 0

#see if one of the old snapshots still exists 
if (Get-Datastore -name iSCSISharedVMs | get-harddisk |where {$_.filename -eq "[iSCSISharedVMs] Snapshot/Snapshot-000001.vmdk"}) {$VM3Snapshot = 1}

#see if the correct snapshot was set  (see note at the end)
if ((get-vm devapp).MemoryGB -eq .75) {$VM3DevApp1 = 1}

#see if any other snapshots exist 
if (!(get-snapshot -vm devapp)) {$VM3DevApp2 = 1}

#add up the points 
$vm3 = $VM3Snapshot + $VM3DevApp1 + $VM3DevApp2

[System.Windows.Forms.MessageBox]::Show("For VM3 you achieved $vm3 out of 3." , "Virtual Machine 3")

Output:

scoring

 

The plan would be to have one link to a script for each item in a set, keeping to the each-item-is-an-island concept that TT started with.

Note:

if ((get-vm devapp).MemoryGB -eq .75) {$VM3DevApp1 = 1}

The VM in question starts the lab with a whole ton of snapshots in multiple trees.  However, only the correct one of those snapshots has the VM set to 786MB of RAM and of course the candidate has no idea the VM hardware is different.  This was originally done to make it very simple to visually score the item.

This entry was posted in Certification, Computing, PowerShell, Scripting, Virtualization, VMware. Bookmark the permalink.

Leave a Reply