You must use cmatch command:
$vms = (Get-VM -Name TEST_vm).Name
if ($vms -cmatch '^[A-Z\0-9\s-]*$') {write-host "name has allowed chars"} else {Write-Warning "name has low chars"}
In this case allowed chars are A-Z, 0-9 and -
First line puts in $vms variable only VM name. You should probably change $vms variable to an array.
If all your VMs must be uppercase, you can also use ToUpper() method. Try this:
$vms.ToUpper()