Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 247559

Re: Creating port groups on a vSphere Distributed Switch with PowerCLI

$
0
0

You can have multiple columns in a CSV, so that is not really a problem.

If you make your CSV something like this

Name,UplinkPorts,Vlan

pg1,32,12

pg2,64,14

pg3,64,2001

You can pass those values in the script like this

$vds = Get-VDSwitch -Name MyVDS

Import-Csv C:\portgroup-names.csv | %{

   New-VDPortgroup -VDSwitch $vds -Name $_.Name -NumPorts $_.UplinkPorts -VlanId $_.Vlan

}

For the other 2 properties, description and uplinknames, you have to set these in another way.

For these you will need to use one of the SDK methods.

In fact the UplinkNames are set on the dvSwitch, not on the dvPortgroup afaik. Unless you mean something else ?

 

I'll get back to you for those 2 missing properties.


Viewing all articles
Browse latest Browse all 247559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>