Good Morning All,
I am attempting to write a script that targets virtual machines that do not have a VMXNET3 network adapter and are not part of a specified list of names but for some reason my line of code is not working and I cannot understand why - the full list of VMs is printed?
$ExcludedList = 'VM1','VM2','VM3'
Get-VM | Get-NetworkAdapter | Where {($_.Type -ne "Vmxnet3") -or ($_.Parent.Name -notcontains $ExcludedList)} | Select @{N="VM";E={$_.Parent.Name}}
Thanks for any help you can provide.