Skip to content

Commit d603d2b

Browse files
vSphere 7.0 updates
Small adjustments to allow the use of Mac learning for VDS versions that newer than 6.6.0 (e.g. VDS 7.0.0) used in vSphere 7.0 and later.
1 parent d0d35de commit d603d2b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

powershell/MacLearn.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
foreach ($dvpgname in $DVPortgroupName) {
2424
$dvpg = Get-VDPortgroup -Name $dvpgname -ErrorAction SilentlyContinue
2525
$switchVersion = ($dvpg | Get-VDSwitch).Version
26-
if($dvpg -and $switchVersion -eq "6.6.0") {
26+
if($dvpg -and $switchVersion -ge "6.6.0") {
2727
$securityPolicy = $dvpg.ExtensionData.Config.DefaultPortConfig.SecurityPolicy
2828
$macMgmtPolicy = $dvpg.ExtensionData.Config.DefaultPortConfig.MacManagementPolicy
2929

@@ -41,7 +41,7 @@
4141
}
4242
$securityPolicyResults
4343
} else {
44-
Write-Host -ForegroundColor Red "Unable to find DVPortgroup $dvpgname or VDS is not running 6.6.0"
44+
Write-Host -ForegroundColor Red "Unable to find DVPortgroup $dvpgname or VDS is not running 6.6.0 or later"
4545
break
4646
}
4747
}
@@ -92,7 +92,7 @@ Function Set-MacLearn {
9292
foreach ($dvpgname in $DVPortgroupName) {
9393
$dvpg = Get-VDPortgroup -Name $dvpgname -ErrorAction SilentlyContinue
9494
$switchVersion = ($dvpg | Get-VDSwitch).Version
95-
if($dvpg -and $switchVersion -eq "6.6.0") {
95+
if($dvpg -and $switchVersion -ge "6.6.0") {
9696
$originalSecurityPolicy = $dvpg.ExtensionData.Config.DefaultPortConfig.SecurityPolicy
9797

9898
$spec = New-Object VMware.Vim.DVPortgroupConfigSpec
@@ -129,8 +129,8 @@ Function Set-MacLearn {
129129
$task1 | Wait-Task | Out-Null
130130
}
131131
} else {
132-
Write-Host -ForegroundColor Red "Unable to find DVPortgroup $dvpgname or VDS is not running 6.6.0"
132+
Write-Host -ForegroundColor Red "Unable to find DVPortgroup $dvpgname or VDS is not running 6.6.0 or later"
133133
break
134134
}
135135
}
136-
}
136+
}

0 commit comments

Comments
 (0)