I was trying to find out Where MDT got all of itâ€™s lovely variables like %SERIALNUMBER% when I stumbled across this Great post from Andrew Barnes on Variables.DAT.
So I popped over and swiped a VARIABLES.DAT file from the WinPE environment and looked at it. As Andrew stated, it was XML data. I find reading XML data about as exciting as painting a bathroom wall with a toothbrush.
Yes, not all the enticed about it, am I?
But I DO love playing with Windows Powershell. And since it can NATIVELY deal with XML files (unless my poor fuzzy human brain) I choose it!
So if youâ€™d like an EASIER way to see what variables you have in VARIABLES.DAT to see how you could play about with them, here is an easier way.
This will dump a list of all the Variable names. Would you like them sorted? Sure!
$MDTVars.MediaVarList.var.Name | SORT-OBJECT
â€œWait! I want to see the values too!â€
(Fussy fussy fussy!)
$MDTVars.MediaVarList.var | SORT-OBJECT
Not anything truly amazing in Powershell but itâ€™s something I found particularly handy today
By the way, Thanks Andrew on that post! Made MY day easier!
â€The Energized Techâ€