I'm trying to export a CSV file that has a list of all VM's in a cluster that don't have a specific tag that I'm using for rightsizing. However, the CSV isn't populating with anything other than this: ÿþ
Get-Module -Name VMware* -ListAvailable | Import-Module -Force
$exportto = "C:\Users\username\Desktop\rightSizingFilter3.csv"
$VMs = Get-Cluster -name clustername | Get-VM
foreach ($VM in $VMs){
If (((Get-Tagassignment $VM).Tag.Name -notcontains "testtag")){
Out-file $exportto -Append
}
}