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:\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
}
}
Out-File
line to$VM | Out-file $exportto -Append
?$VMs | Where-Object { $_.Tag.Name -notcontains "testtag" } | Out-File $ExportTo -Append
vm_name PoweredOn 2 8.000
. It would be preferential to just have the vm_name.