From f0df1fff506c21fabb628ccfc078e054f466ec5e Mon Sep 17 00:00:00 2001 From: lokesh Date: Wed, 13 Aug 2014 11:22:15 +0530 Subject: [PATCH] adding changes to Readme regarding dependencies and try catch ps and diskpart --- README.md | 2 +- .../diskimagebuilder.ps1 | 28 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index eddca21..6ef25c0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Baremetal Servers. This is made possible by injecting user provided drivers usin Creates a Image file, Includes cloudbase-init package by default. User can create image by adding custom drivers, VirIO Drivers by providing suitable ISO or inf files. Enable Roles like Hyperv , TFTP etc., Use below formats to run script. -Runs on Windows 8, 8.1 and 2012 R2 +Runs on Windows 7,8, 8.1 and 2012 R2 ( To run this tool on Windows 7 it needs WAIK to be installed inorder to use dism /apply-image ) Requires Powershell 3.0 or above and wim file from ISO Source folder. ISO is not required. Only Wim file is enough to generate and apply wim to vhd. diff --git a/windows-diskimage-builder/diskimagebuilder.ps1 b/windows-diskimage-builder/diskimagebuilder.ps1 index 13f99f7..f8465f0 100644 --- a/windows-diskimage-builder/diskimagebuilder.ps1 +++ b/windows-diskimage-builder/diskimagebuilder.ps1 @@ -13,6 +13,7 @@ # under the License. + # Creates a Image file, Includes cloudbase-init package by default. # User can create image by adding custom drivers, VirIO Drivers by providing suitable ISO or inf files. Enable Roles like Hyperv , TFTP etc., Use below formats to run script. @@ -343,22 +344,23 @@ foreach($p in $testpaths){ -#try { -# Createvhd | Out-File -# PscreatePartition +try { + if($disklayout){ + $Errorvalue = 1 + }else{ + Createvhd + PscreatePartition + } -#} catch{ -# Write-W2VInfo "Could not run through hyperv module will use diskpart..." -# $Errorvalue = 1 +} catch{ + Write-W2VInfo "Could not run through hyperv module will use diskpart..." + $Errorvalue = 1 -#} +} -#if($Errorvalue){ - - CreateThrwDiskpart - - -#} +if($Errorvalue){ + CreateThrwDiskpart +} CreateBootfiles