I am using this line to find the datastore name for each guest:
$row.DatastoreName = get-datastore -vm $_ | % {$_.name}
the output in the CSV file looks like vmax2345-sata-81 or instead of sata the output might contain fc.
I would like to change this value based on whether or not the variable contains sata or fc, to Tier3 or Tier2.
I am reading about this now.
advice would be greatly appreciated.
thanks
See if this helps. Watch out though the fc match may be a bit of refining so it is not to general. It could grab more than you want if other names have fc some where else in them. Hope it helps though.
Get-Datastore | foreach{ if($_.Name -match "sata"){echo "SATA";}elseif($_.Name -match "fc"){echo "fc";}};
this is what i ended up with. customer is custom field with billing information. Thanks for the input ProPenguin.