private string WinPELayout()
{
string partitionScript = null;
if (ImageSchema.HardDrives[HdNumberToGet].Table.ToLower() == "gpt")
{
foreach (var partition in clientSchema.PrimaryAndExtendedPartitions)
{
if (partition.Type.ToLower() == "recovery")
{
partitionScript +=
"New-Partition " + ClientHd + " -GptType '{de94bba4-06d1-4d40-a16a-bfd50179d6ac}' -Size " + partition.Size * ImageSchema.HardDrives[HdNumberToGet].Lbs / 1024 / 1024 + "MB | Format-Volume -FileSystem NTFS -NewFileSystemLabel WindowsRE 2>&1 >> $clientLog\r\n";
}
else if (partition.Type.ToLower() == "system")
{
long partitionSize = 0;
if (clientBlockSize >= 4096 &&
(partition.Size*ImageSchema.HardDrives[HdNumberToGet].Lbs/1024/1024) < 260)
partitionSize = 260;
else
{
partitionSize = partition.Size*ImageSchema.HardDrives[HdNumberToGet].Lbs/1024/1024;
}
partitionScript +=
"New-Partition " + ClientHd + " -GptType '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}' -Size " + partitionSize + "MB 2>&1 >> $clientLog\r\n";// | Format-Volume -FileSystem FAT32 -NewFileSystemLabel System\r\n";
}
else if (partition.Type.ToLower() == "reserved")
{
partitionScript +=
"New-Partition " + ClientHd + " -GptType '{e3c9e316-0b5c-4db8-817d-f92df00215ae}' -Size " + partition.Size * ImageSchema.HardDrives[HdNumberToGet].Lbs / 1024 / 1024 + "MB 2>&1 >> $clientLog\r\n";
}
else if (partition.Type.ToLower() == "basic")
{
partitionScript +=
"New-Partition " + ClientHd + " -GptType '{ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}' -Size " + partition.Size * ImageSchema.HardDrives[HdNumberToGet].Lbs / 1024 / 1024 + "MB | Format-Volume -FileSystem NTFS 2>&1 >> $clientLog\r\n";
}
}
}
else //mbr
{
foreach (var partition in clientSchema.PrimaryAndExtendedPartitions)
{
var isActive = "";
if (partition.Number == ImageSchema.HardDrives[HdNumberToGet].Boot)
isActive = "-IsActive";
partitionScript +=
"New-Partition " + ClientHd + " -MbrType " + partition.Type + " -Size " + partition.Size * ImageSchema.HardDrives[HdNumberToGet].Lbs / 1024 / 1024 + "MB " + isActive + " | Format-Volume -FileSystem " + partition.FsType + " 2>&1 >> $clientLog\r\n";
}
}
return partitionScript;
}