diff --git a/Scripts/3_Deploy.ps1 b/Scripts/3_Deploy.ps1 index d0401f80..c73d7b4a 100644 --- a/Scripts/3_Deploy.ps1 +++ b/Scripts/3_Deploy.ps1 @@ -912,7 +912,7 @@ If (-not $isAdmin) { $vSwitches | Select-Object Name,NetAdapterInterfaceDescriptions WriteErrorAndExit "At least one NIC is connected to existing Virtual Switch, different than specified in Labconfig ($SwitchName)" }else{ - New-VMSwitch -SwitchType External -Name $SwitchName -EnableEmbeddedTeaming $true -EnableIov $true -NetAdapterName $LabConfig.SwitchNics -AllowManagementOS $False + New-VMSwitch -Name $SwitchName -EnableEmbeddedTeaming $true -EnableIov $true -NetAdapterName $LabConfig.SwitchNics -AllowManagementOS $False } }else{ New-VMSwitch -SwitchType Private -Name $SwitchName @@ -958,7 +958,7 @@ If (-not $isAdmin) { WriteSuccess "`t External vSwitch $ExternalSwitchName detected" }else{ WriteInfo "`t Detecting external VMSwitch" - $ExtSwitch=Get-VMSwitch -SwitchType External + $ExtSwitch=Get-VMSwitch -SwitchType External | Where-Object Name -NotLike $SwitchName if (!$ExtSwitch){ WriteInfoHighlighted "`t No External Switch detected. Will create one " $TempNetAdapters=get-netadapter | Where-Object Name -NotLike vEthernet* | Where-Object status -eq up diff --git a/Scripts/Cleanup.ps1 b/Scripts/Cleanup.ps1 index 254dcf78..9fa279a6 100644 --- a/Scripts/Cleanup.ps1 +++ b/Scripts/Cleanup.ps1 @@ -26,6 +26,9 @@ If (-not $isAdmin) { if (-not ($LabConfig.Prefix)){ $labconfig.Prefix="$($PSScriptRoot | Split-Path -Leaf)-" } + if (-not ($LabConfig.SwitchName)){ + $labconfig.SwitchName="LabSwitch" + } #grab all VMs, switches and DC $VMs=Get-VM -Name "$($LabConfig.Prefix)*" | Where-Object Name -ne "$($LabConfig.Prefix)DC" -ErrorAction SilentlyContinue | Sort-Object -Property Name diff --git a/Scripts/LabConfig.ps1 b/Scripts/LabConfig.ps1 index 43574399..e9de464a 100644 --- a/Scripts/LabConfig.ps1 +++ b/Scripts/LabConfig.ps1 @@ -20,7 +20,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M AdminPassword='LS1setup!'; # Used during 2_CreateParentDisks. If changed after, it will break the functionality of 3_Deploy.ps1 Prefix = 'MSLab-'; # (Optional) All VMs and vSwitch are created with this prefix, so you can identify the lab. If not specified, Lab folder name is used SwitchName = 'LabSwitch'; # (Optional) Name of vSwitch - SwitchNICs = 'NIC1",NIC2" ; # (Optional) Adds these NICs to vSwitch (without connecting host). + SwitchNICs = 'NIC1",NIC2" ; # (Optional) Adds these NICs to vSwitch (without connecting hostOS). SecureBoot=$true; # (Optional) Useful when testing unsigned builds (Useful for MS developers for daily builds) DCEdition='4'; # 4 for DataCenter or 3 for DataCenterCore InstallSCVMM='No'; # (Optional) Yes/Prereqs/SQL/ADK/No