PoshCode Archive  Artifact [d5433be1b0]

Artifact d5433be1b09d8b5c0563281f885a7dcc03dc47ccbc905e29945617be819088ed:

  • File PS-ImgBurn-burn-all-ISOs.ps1 — part of check-in [558b2d96ff] at 2018-06-10 13:36:24 on branch trunk — Combine powershell and ImbBurn to burn all the iso’s in a directory. Useful for burning the 7 vista iso files etc. (user: Michael size: 1114)

# 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