How to automatically unpack MOC and Base VHDs archives using PowerShell | Cursuri microsoft
15637
post-template-default,single,single-post,postid-15637,single-format-standard,bridge-core-1.0.6,ajax_fade,page_not_loaded,,qode_grid_1200,qode-theme-ver-18.2,qode-theme-bridge,qode_header_in_grid,wpb-js-composer js-comp-ver-6.0.5,vc_responsive

How to automatically unpack MOC and Base VHDs archives using PowerShell

test

As trainers I consider that we spend a disproportional amount of time to prepare the classrooms for our classes.

Any new course is a new challenge.

Estimated 8h classroom setup ends in more than 2 days for the first time (ex 10750A, 10751A…)
So any automation that can save time will give us more free time to prepare our courses or spend with friends.

One of the activities that consumes a lot of time is unpacking the downloaded course archives.

The annoying thing is that we need to introduce confirmation after starting each unpack action.

In most cases running more unrar action in parallel will not make the whole action to finish earlier.

So I looked for a solution to make this action simpler.

From various solution found on the net I picked up a script from Classroom Setup Tools v1.1 – http://pscst.codeplex.com – by Ingo Karstein (http://ikarstein.wordpress.com) (all his credits reserved)

I made my own customizations and now I have 2 version: Unpack MOC V1a and Unpack MOC V1b

After Ver1a script you will find Ver1b script.

Unpack MOC V1a

In Ver1a we use a folder in which we temporarily move the downloaded archives.

After unpack operation we move the folders back in the initial location.

The Ver1a of script for course 10748 will look like this:

################################################################################################################################################

# Unpack MOC V1a#

# Automatically unpack(unrar) MOC downloaded courses files

#

# No list of folders used, just move folders with archived files to a defined source folder#

# Make folder $SourcePath1 (Moc Archives) on the volume ($SourceDriveLetter1)  as temporary work folder

# MANUALY move the MOC archives to be unpacked to the $SourcePath1 (Moc Archives) folder

# After finishing unpacking MANUALY move archives to the original locations

# Destination folders are set to the MOC default location

#

# Used variables:

# $Course = Number of the course (NO version included – ex:10748 and not 10748A or 10748B, etc)

# $DestDriveLetter1 = Volume for Course VM’s

# $SourcePath1 = Path of the folder where the MOC downloaded files are located

# $DestPath2 = Destination folder where the unpacked MOC files will be located

# $UnrarPath = Location of the unrar.exe file – need to be downloaded

# Download unrarw32.exe from http://www.rarlab.com/rar/unrarw32.exe and extract unrar.exe to the $UnrarPath folder

#

# Done by Florin Nicolescu –MCT  florin@learningsolution.ro ;   www.learningsolution.rowww.cursurimicrosoft.com

# Based on a script from Classroom Setup Tools v1.1 – http://pscst.codeplex.com – by Ingo Karstein (http://ikarstein.wordpress.com)

#

#################################################################################################################################################

$Course = “10748”

$DestDriveLetter1 = “c”

$SourceDriveLetter1 = “i”

$DestPath1 = -join ($DestDriveLetter1,”:Program FilesMicrosoft Learning”)

$SourcePath1 = -join ($SourceDriveLetter1,”:Moc Archives”)

$UnrarPath = -join ($DestDriveLetter1,”:Program FilesMicrosoft Learning”)

$DestPath2 = -join ($DestDriveLetter1,”:Program FilesMicrosoft Learning”,$Course,Drives””””)”

No Comments

Post A Comment