Try something like this
$dvSw=Get-VDSwitch-Name"Boston"
Import-CsvdvPortgroups.csv-UseCulture|%{
New-VDPortgroup-Name$_.PgName-VlanId$_.VLanId-NumPorts$_.Ports-VDSwitch$dvSw
}
The CSV file is expected to have 3 columns
PgName,VLanId,Ports
pg1,100,32
pg2,100,32
You might want to check the number of available ports on the dvSwitch first, to check if you can add ll the requested ports for the portgroups