hye so i try to do some script for taking exe files and extract them to host then it will import all extraced vms to hyper-v manager then configure the vms virtualswitch and take all snapshot.
give me so review on the code, and if it possible maybe tips and diffrent ways to apply the script
import-module c:\hyperv\hyperv.psd1"script begin-export base"
$a_1=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\BASE-20417B\MT12-WS12-LON-DC1-TMP\MT12-WS12-LON-DC1-TMP.part1.exe' /s
$a_2=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\BASE-20417B\Base12A-WS12-TMP\Base12A-WS12-TMP.part01.exe' /s
$a_3=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\Base12B-W8\Base12B-W8.part01.exe' /s
$a_4=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\MT12-W8-CL1-Office2010SP1\MT12-W8-CL1-Office2010SP1.part01.exe' /s"script step 2- export vms"
$b_1=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-CL1.exe' /s
$b_2=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-CORE.part01.exe' /s
$b_3=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-CL2.exe' /s
$b_4=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-DC1.exe' /s
$b_5=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-DC1-B.part01.exe' /s
$b_6=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-Host1.exe' /s
$b_7=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-Host2.exe' /s
$b_8=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-svr1.part1.exe' /s
$b_9=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-SVR1-B.part01.exe' /s
$b_10=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-SVR2.part1.exe' /s
$b_11=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-SVR3.exe' /s
$b_12=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-SVR4.exe' /s
$b_13=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-LON-SVR5.exe' /s
$b_14=start-process -wait -filepath '\\it\e$\Courseware\MSCA\Hyper V\Virtual Machines\20417B- Part 2 - Virtual Machines- Upgrading Your Skills to MCSA Windows Server 2012\20417B-MUN-DC1.part1.exe' /s"script step 3-batch files"
echo e | & 'C:\Program Files\Microsoft Learning\20417\Drives\20417B-LON-CL1\VM-Pre-Import-20417B-LON-CL1.bat'
echo e | & 'C:\Program Files\Microsoft Learning\20417\Drives\20417B-LON-CL2\VM-Pre-Import-20417B-LON-CL2.bat'
echo e | & 'C:\Program Files\Microsoft Learning\20417\Drives\20417B-LON-DC1\VM-Pre-Import-20417B-LON-DC1.bat'
echo e | & 'C:\Program Files\Microsoft Learning\20417\Drives\20417B-LON-SVR2\VM-Pre-Import-20417B-LON-SVR2.bat'
echo e | & 'C:\Program Files\Microsoft Learning\20417\Drives\20417B-LON-SVR3\VM-Pre-Import-20417B-LON-SVR3.bat'
echo e | & 'C:\Program Files\Microsoft Learning\20417\Drives\20417B-LON-SVR4\VM-Pre-Import-20417B-LON-SVR4.bat'
echo e | & 'C:\Program Files\Microsoft Learning\20417\Drives\20417B-MUN-DC1\VM-Pre-Import-20417B-MUN-DC1.bat'"script step 4- import vm"
$c_1=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-CL1'
$c_2=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-CL2'
$c_3=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-CORE'
$c_4=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-DC1'
$c_5=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-DC1-B'
$c_6=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-SVR1'
$c_7=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-SVR1-B'
$c_8=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-SVR2'
$c_9=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-SVR3'
$c_10=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-SVR4'
$c_11=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-LON-SVR5'
$c_12=import-vm -path 'C:\Program Files\microsoft learning\20417\Drives\20417B-MUN-DC1'"script step 5-configure network and snapshot"
$n=get-vm | where-object {$_.vmelementname -like '20417B-*-*' } | new-vmsnapshot -force
$n2=get-vmnic | where-object {$_.vmelementname -like '20417B-*-*'} | set-vmnicswitch -virtualswitch 'private network'