Zend certified PHP/Magento developer

How to loop through VMs without a specific tag with powercli

I’m trying to export a CSV file that has a list of all VM’s in a cluster that doesn’t have a specific tag I’m using for rightsizing. However, the list CSV isn’t populating with anything other than this: ÿþ

Get-Module -Name VMware* -ListAvailable | Import-Module -Force
$exportto = "C:UsersusernameDesktoprightSizingFilter3.csv"
$VMs = Get-Cluster -name clustername | Get-VM
 
foreach ($VM in $VMs){
    If (((Get-Tagassignment $VM).Tag.Name -notcontains "testtag")){
         Out-file $exportto -Append
    }
}