From d07c54744c0f2275e78d2eed6d330efd53372c08 Mon Sep 17 00:00:00 2001 From: Winston Smith Date: Mon, 28 Jun 2021 17:36:27 +0200 Subject: [PATCH] Revert "Feat: Add VNetwork creation" This reverts commit ca6ee46dc17ba919f3a7a40a899e52f54405d55d. --- Host/Bootstrap-Hyper-V.ps1 | 46 +++++--------------------------------- Host/Create-ALL.ps1 | 26 +++++++++------------ 2 files changed, 17 insertions(+), 55 deletions(-) diff --git a/Host/Bootstrap-Hyper-V.ps1 b/Host/Bootstrap-Hyper-V.ps1 index cb4d363..63a8279 100644 --- a/Host/Bootstrap-Hyper-V.ps1 +++ b/Host/Bootstrap-Hyper-V.ps1 @@ -1,40 +1,6 @@ -# Bootstrap script to init Hyper-v - -echo "Shamefully made by Alexandre Simao. Pardon-me dear M. Stallman" -echo "GPLv3" - -### Define variables - -$scripts_path = Read-host "Scripts path?" -$vhd_path = Read-host "VHD path?" -$vm_path = Read-Host "VM path?" -$source_path = Read-host "Actual source path?" -$base_srv = Read-Host "SRV base disk name without extension?" -$base_cli = Read-Host "CLI base disk name without extension?" - -### Store them as ENV vars - -$env:SCRIPTS_PATH = ${scripts_path} -$env:VHD_PATH = ${vhd_path} -$env:VM_PATH = ${vm_path} -$env:SOURCE_PATH = ${source_path} -$env:BASE_SRV = ${base_srv} -$env:BASE_CLI = ${base_cli} - -### Let the fuckery begins! - -md ${vhd_path} -md ${vhdpath}\Base -md ${vm_path} - -Move-Item ${source_path} ${vhd_path} - -New-VHD -ParentPath ${vhd_path}\source\${base_srv}.vhdx -Path ${vhd_path}\Base\Base_SRV_diff.vhdx -Differencing -New-VHD -ParentPath ${vhd_path}\source\${base_cli}.vhdx -Path ${vhd_path}\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 +New-Item -Path "d:\" -Name "VHD" -ItemType "directory" +New-Item -Path "d:\" -Name "VM" -ItemType "directory" +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 diff --git a/Host/Create-ALL.ps1 b/Host/Create-ALL.ps1 index e4dcd43..36cb0e5 100644 --- a/Host/Create-ALL.ps1 +++ b/Host/Create-ALL.ps1 @@ -17,9 +17,8 @@ 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 ${scripts_path}\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" -Copy-Item ${scripts_path}\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" +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" Copy-item ${scripts_path}\Guests\SRV-01.ps1 "${Driveletter}:\Tools\scripts\boot.ps1" @@ -50,9 +49,8 @@ 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 ${scripts_path}\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" -Copy-Item ${scripts_path}\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" +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" Copy-item ${scripts_path}\Guests\SRV-03.ps1 "${Driveletter}:\Tools\scripts\boot.ps1" @@ -85,9 +83,8 @@ 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 ${scripts_path}\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" -Copy-Item ${scripts_path}\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" +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" Copy-item ${scripts_path}\Guests\RTR-01.ps1 "${Driveletter}:\Tools\scripts\boot.ps1" @@ -122,9 +119,9 @@ 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 ${scripts_path}\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" -Copy-Item ${scripts_path}\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" +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" +>>>>>>> parent of ca6ee46 (Feat: Add VNetwork creation) mkdir "${Driveletter}:\Tools\Scripts" Copy-item ${scripts_path}\Guests\RTR-02.ps1 "${Driveletter}:\Tools\scripts\boot.ps1" @@ -159,9 +156,8 @@ 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 ${scripts_path}\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml" -Copy-Item ${scripts_path}\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd" +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" Copy-item ${scripts_path}\Guests\RTR-03.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"