For example, if you have the data in a CSV like this
Name,VLANId
Test1,100
Test2,101
you could do something like this
$dvSwName = 'vdSw1'
$dvs = Get-VDSwitch -Name $dvSwName
Import-Csv -Path .\portgroup.csv -UseCulture -PipelineVariable row |
ForEach-Object -Process {
New-VDPortgroup -VDSwitch $dvs -Name $row.Name -VlanId $row.VLANId -Confirm:$false
}