﻿# encoding: utf-8
# api: powershell
# title: PS+ImgBurn burn all ISOs
# description: Combine powershell and ImbBurn to burn all the iso’s in a directory. Useful for burning the 7 vista iso files etc.
# version: 0.1
# type: function
# author: Michael
# license: CC0
# function: burn-file
# x-poshcode-id: 410
# x-archived: 2016-05-19T09:19:43
# x-published: 2009-05-27T19:43:00
#
#
function burn()
{
#get the files and ship them to burn-file
dir -recurse -include *.iso -path c:\,d:\,e:\ | foreach { burn-file $_.FullName }
}

function burn-file($filename)
{
#call img burn with the nessessary arguments
. "c:\Program Files\ImgBurn\ImgBurn.exe" /mode ISOWRITE /WAITFORMEDIA /start /close /DELETEIMAGE /EJECT /SRC $filename
#Wait for IMGBURN to finish (right now you can only have one open at a time)
while ( (get-process | where{$_.ProcessName -eq "ImgBurn"}) -ne $null)
{
#sleep for a bit to let the processor work on burning
Start-Sleep â��s 10
#tell the user what file you are still working on
"waiting for $filename to complete"
}

}

#call the burn function
burn
