Try something like this
Import-Csv devimport.csv | %{
Get-VM -Name $_.VM | Set-Annotation -CustomAttribute 'Chargeback Code' -Value $_.'Chargeback Code'
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Import-Csv devimport.csv | %{
Get-VM -Name $_.VM | Set-Annotation -CustomAttribute 'Chargeback Code' -Value $_.'Chargeback Code'
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks...I will test. Do I need to change the format of my csv file? Does it look ok with the fields and variables I have in there?
Also, will this script make any changes to other VMs that don't have anything in the 'chargeback code' field?
I used the CSV you attached as the inpu file, so no, you don't have to change anything.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Once again LucD, it worked like a champ. Many thanks :smileycool: