Like this ?
$VCenterServer=server
$VMCluster="Production"
Connect-ViServer$VCenterServer
# Stick current DRS rules into an array
$DrsRules=Get-DrsRule-Cluster$VMCluster
Get-Cluster$VMCluster|Get-VM-Name'*[ab]v'|
Group-Object-Property {$_-match"(?<name>.*)[a|b]v"; $Matches["name"]} |
Where-Object {$_.Count -eq2} |
ForEach-Object {
if($DrsRules.name -notcontains"$($_.Values[0][1])-AB"){
New-DrsRule-Cluster$VMCluster-Name"$($_.Values[0][1])-AB"-KeepTogether$false-VM$_.Group
}
}