Fix: Dynamic VHD path + sleep 15 SRV
This commit is contained in:
parent
a6fec54782
commit
d9c22633c5
|
@ -10,11 +10,13 @@ echo "GPLv3"
|
|||
echo "Adding and configuring SRV-01"
|
||||
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-01.vhdx
|
||||
|
||||
Mount-VHD d:\VHD\SRV-01.vhdx
|
||||
Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||
Copy-Item D:\Scripts\deploy.cmd -Destination e:\conf\deploy.cmd
|
||||
mkdir e:\Tools\Scripts
|
||||
Copy-item d:\Scripts\Guests\SRV-01.ps1 E:\Tools\scripts\boot.ps1
|
||||
$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 + ":"
|
||||
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 d:\Scripts\Guests\SRV-01.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
|
||||
|
||||
Dismount-VHD d:\VHD\SRV-01.vhdx
|
||||
|
||||
|
@ -40,11 +42,14 @@ Set-VMNetworkAdapter -VMName 'SRV-01' -Name "Arc-SRV" -DeviceNaming on
|
|||
echo "Adding and configuring SRV-03"
|
||||
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-03.vhdx
|
||||
|
||||
Mount-VHD d:\VHD\SRV-03.vhdx |Get-Disk
|
||||
Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||
Copy-Item D:\Scripts\deploy.cmd -Destination e:\conf\deploy.cmd
|
||||
mkdir e:\Tools\Scripts
|
||||
#Copy-item d:\Scripts\Guests\SRV-03.ps1 E:\Tools\scripts\boot.ps1
|
||||
$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 + ":"
|
||||
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 d:\Scripts\Guests\SRV-03.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
|
||||
|
||||
Dismount-VHD d:\VHD\SRV-03.vhdx
|
||||
|
||||
$vms = @{
|
||||
|
@ -71,12 +76,13 @@ Set-VMNetworkAdapter -VMName 'SRV-03' -Name "Bou-Lan" -DeviceNaming on
|
|||
echo "Adding and configuring RTR-01"
|
||||
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-01.vhdx
|
||||
|
||||
Mount-VHD d:\VHD\RTR-01.vhdx
|
||||
|
||||
Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||
Copy-Item D:\Scripts\deploy.cmd -Destination e:\conf\deploy.cmd
|
||||
mkdir e:\Tools\Scripts
|
||||
Copy-item d:\Scripts\Guests\RTR-01.ps1 E:\Tools\scripts\boot.ps1
|
||||
$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 + ":"
|
||||
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 d:\Scripts\Guests\RTR-01.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
|
||||
|
||||
Dismount-VHD d:\VHD\RTR-01.vhdx
|
||||
|
||||
|
@ -106,12 +112,13 @@ Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN" -Name "WAN" -DeviceNamin
|
|||
echo "Adding and configuring RTR-02"
|
||||
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-02.vhdx
|
||||
|
||||
Mount-VHD d:\VHD\RTR-02.vhdx
|
||||
|
||||
Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||
Copy-Item D:\Scripts\deploy.cmd -Destination e:\conf\deploy.cmd
|
||||
mkdir e:\Tools\Scripts
|
||||
Copy-item D:\scripts\Guests\RTR-02.ps1 E:\Tools\scripts\boot.ps1
|
||||
$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 + ":"
|
||||
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 d:\Scripts\Guests\RTR-02.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
|
||||
|
||||
Dismount-VHD d:\VHD\RTR-02.vhdx
|
||||
|
||||
|
@ -141,12 +148,13 @@ Add-VMNetworkAdapter -VMName "RTR-02" -SwitchName "WAN" -Name "WAN" -DeviceNamin
|
|||
echo "Adding and configuring RTR-03"
|
||||
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-03.vhdx
|
||||
|
||||
Mount-VHD d:\VHD\RTR-03.vhdx
|
||||
|
||||
Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml
|
||||
Copy-Item D:\Scripts\deploy.cmd -Destination e:\conf\deploy.cmd
|
||||
mkdir e:\Tools\Scripts
|
||||
Copy-item d:\Scripts\Guests\RTR-03.ps1 E:\Tools\scripts\boot.ps1
|
||||
$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 + ":"
|
||||
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 d:\Scripts\Guests\RTR-03.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
|
||||
|
||||
Dismount-VHD d:\VHD\RTR-03.vhdx
|
||||
|
||||
|
@ -173,11 +181,11 @@ Add-VMNetworkAdapter -VMName "RTR-03" -SwitchName "Aston" -Name "Aston" -DeviceN
|
|||
echo "Starting VMs"
|
||||
Start-VM -Name RTR*
|
||||
|
||||
### Sleeping 30s
|
||||
### Sleeping 15s
|
||||
|
||||
echo "Sleeping 30"
|
||||
echo "Sleeping 15s"
|
||||
|
||||
Sleep 30
|
||||
Sleep 15
|
||||
|
||||
|
||||
Start-VM -Name SRV*
|
||||
|
|
Loading…
Reference in New Issue