From ca6ee46dc17ba919f3a7a40a899e52f54405d55d Mon Sep 17 00:00:00 2001 From: Alexandre Simao Date: Mon, 28 Jun 2021 16:11:41 +0200 Subject: [PATCH] Feat: Add VNetwork creation --- Host/Bootstrap-Hyper-V.ps1 | 7 +++++++ Host/Create-ALL.ps1 | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/Host/Bootstrap-Hyper-V.ps1 b/Host/Bootstrap-Hyper-V.ps1 index 63a8279..8440d83 100644 --- a/Host/Bootstrap-Hyper-V.ps1 +++ b/Host/Bootstrap-Hyper-V.ps1 @@ -4,3 +4,10 @@ New-Item -Path "d:\VHD" -Name "Base" -ItemType "directory" Move-Item d:/sources d:/VHD/ New-VHD -ParentPath d:\VHD\source\Base_2016_14393.161220_StdGUI_G2_upd28022017.vhdx -Path d:\VHD\Base\Base_SRV_diff.vhdx -Differencing New-VHD -ParentPath d:\VHD\source\Master_Win10_20h2_x86_G1.vhdx -Path d:\VHD\Base\Base_CLI_diff.vhdx -Differencing + +### Create VMNetworks +New-VMSwitch -name Arc-CLI -SwitchType Private +New-VMSwitch -name Arc-SRV -SwitchType Private +New-VMSwitch -name Bou-LAN -SwitchType Private +New-VMSwitch -name WAN -SwitchType Private +New-VMSwitch -name Aston -NetAdapterName Ethernet -AllowManagementOS $true diff --git a/Host/Create-ALL.ps1 b/Host/Create-ALL.ps1 index 79cd156..5812d01 100644 --- a/Host/Create-ALL.ps1 +++ b/Host/Create-ALL.ps1 @@ -13,6 +13,7 @@ cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-01.vhdx $Lettre = Mount-VHD -Path "d:\VHD\SRV-01.VHDx" -PassThru | Get-Disk | Get-Partition | Get-Volume | Sort-Object -Property Size -Descending | Select-Object -First 1 $DriveLetter = $Lettre.DriveLetter $drive = $DriveLetter + ":" +New-Item -Path "${Driveletter}:\conf\" -Name "Base" -ItemType "directory" Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" Copy-Item D:\Scripts\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" mkdir "${Driveletter}:\Tools\Scripts" @@ -45,6 +46,7 @@ cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-03.vhdx $Lettre = Mount-VHD -Path "d:\VHD\SRV-03.VHDx" -PassThru | Get-Disk | Get-Partition | Get-Volume | Sort-Object -Property Size -Descending | Select-Object -First 1 $DriveLetter = $Lettre.DriveLetter $drive = $DriveLetter + ":" +New-Item -Path "${Driveletter}:\conf\" -Name "Base" -ItemType "directory" Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" Copy-Item D:\Scripts\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" mkdir "${Driveletter}:\Tools\Scripts" @@ -79,6 +81,7 @@ cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-01.vhdx $Lettre = Mount-VHD -Path "d:\VHD\RTR-01.VHDx" -PassThru | Get-Disk | Get-Partition | Get-Volume | Sort-Object -Property Size -Descending | Select-Object -First 1 $DriveLetter = $Lettre.DriveLetter $drive = $DriveLetter + ":" +New-Item -Path "${Driveletter}:\conf\" -Name "Base" -ItemType "directory" Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" Copy-Item D:\Scripts\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" mkdir "${Driveletter}:\Tools\Scripts" @@ -115,6 +118,7 @@ cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-02.vhdx $Lettre = Mount-VHD -Path "d:\VHD\RTR-02.VHDx" -PassThru | Get-Disk | Get-Partition | Get-Volume | Sort-Object -Property Size -Descending | Select-Object -First 1 $DriveLetter = $Lettre.DriveLetter $drive = $DriveLetter + ":" +New-Item -Path "${Driveletter}:\conf\" -Name "Base" -ItemType "directory" Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" Copy-Item D:\Scripts\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" mkdir "${Driveletter}:\Tools\Scripts" @@ -151,6 +155,7 @@ cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-03.vhdx $Lettre = Mount-VHD -Path "d:\VHD\RTR-03.VHDx" -PassThru | Get-Disk | Get-Partition | Get-Volume | Sort-Object -Property Size -Descending | Select-Object -First 1 $DriveLetter = $Lettre.DriveLetter $drive = $DriveLetter + ":" +New-Item -Path "${Driveletter}:\conf\" -Name "Base" -ItemType "directory" Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" Copy-Item D:\Scripts\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" mkdir "${Driveletter}:\Tools\Scripts"