Hello. I'm trying to get this script to populate a csv file with vCenter names, start of Mac address range and end of Mac address range per vCenter server provided in the vclist.csv file. Here's what I have for now. When I run the script, I'm being prompted for an input object. The script appears to just populate the result vclist2.csv file with the length of the character. Can someone please help? Sorry I'm stil in the learning phase of Pwershell/PowerCLI so any help here would be greatly appreciated. Thank you.
Below is the script
*********************************************
$vclist = import-csv .\vclist.csv
Foreach ($vc in $vclist) {
$vCenterSettings = Get-View -Id 'OptionManager-VpxSettings'
$macaddress_begin = ($vCenterSettings.Setting | Where-Object { $_.Key -eq "config.vpxd.macAllocScheme.rangeScheme.range[0].begin"}).Value
$macaddress_end = ($vCenterSettings.Setting | Where-Object { $_.Key -eq "config.vpxd.macAllocScheme.rangeScheme.range[0].end"}).Value
Export-Csv -Path "d:\vclist2.csv"
}