Reply to Message

View discussion in a popup

Replying to:
zare_N0222
Enthusiast
Enthusiast

I managed to import , I google it for a bit.  basically, file has three columns , first Name, second VLAN id , and 3rd number of ports.

$file = Import-Csv d:\_scripts\VBs\port.csv -Header @("Name","vlan", "NumPorts")
foreach ($vlan in $file)
{

Get-VDSwitch -Name "DSwitch" | New-VDPortgroup -Name $vlan.Name -VLanId $vlan.vlan -NumPorts $vlan.NumPorts
}

Reply
0 Kudos