File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -26,20 +26,17 @@ Add-Type -TypeDefinition @"
26
26
}
27
27
"@
28
28
29
- function GetSwitchEthernetPortAllocationSettingData ($vswitchName )
30
- {
29
+ function GetSwitchEthernetPortAllocationSettingData ($vswitchName ) {
31
30
$eps = @ ()
32
31
$eps += gwmi - Namespace $ns - Class Msvm_ExternalEthernetPort
33
32
$eps += gwmi - Namespace $ns - Class Msvm_InternalEthernetPort
34
- foreach ($ep in $eps )
35
- {
33
+ foreach ($ep in $eps ) {
36
34
$lep1 = gwmi - Namespace $ns - Query " ASSOCIATORS OF {$ep } WHERE ResultClass=Msvm_LANEndpoint AssocClass=Msvm_EthernetDeviceSAPImplementation"
37
35
if ($lep1 ) {
38
36
$lep2 = gwmi - Namespace $ns - Query " ASSOCIATORS OF {$lep1 } WHERE ResultClass=Msvm_LANEndpoint AssocClass=Msvm_ActiveConnection"
39
37
$eswp = gwmi - Namespace $ns - Query " ASSOCIATORS OF {$lep2 } WHERE ResultClass=Msvm_EthernetSwitchPort AssocClass=Msvm_EthernetDeviceSAPImplementation"
40
38
$sw = gwmi - Namespace $ns - Query " ASSOCIATORS OF {$eswp } WHERE ResultClass=Msvm_VirtualEthernetSwitch"
41
- if ($sw.ElementName -eq $vswitchName )
42
- {
39
+ if ($sw.ElementName -eq $vswitchName ) {
43
40
return gwmi - Namespace $ns - Query " ASSOCIATORS OF {$eswp } WHERE ResultClass=Msvm_EthernetPortAllocationSettingData AssocClass=Msvm_ElementSettingData"
44
41
}
45
42
}
You can’t perform that action at this time.
0 commit comments