VMware Cloud Community
chenzb0121
Enthusiast
Enthusiast

How can i change vm remark by powercli?

I want to change 1000 vm's remark , but i don't know!

I want to change the vm's note(remark) in the vCenter.

虚拟机备注.png

Labels (2)
0 Kudos
5 Replies
LucD
Leadership
Leadership

Basically, that can be done with the Set-VM cmdlet and the Notes parameter.

Get-VM -Name MyVM | Set-VM -Notes 'Newnotes'

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
chenzb0121
Enthusiast
Enthusiast

Thank you very much! But your method requires manual verification。I make it. 解决方法.png

 

.I make a csv(utf-8)  and import it  to  powercli 。 use the code in the pic , to change the vm's notes without manual verification。

0 Kudos
chenzb0121
Enthusiast
Enthusiast

How to make it without confirmation?

0 Kudos
LucD
Leadership
Leadership

Like this

Get-VM -Name MyVM | Set-VM -Notes 'Newnotes' -Confirm:$false


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

chenzb0121
Enthusiast
Enthusiast

Yes,You are right. Thank you very much !

0 Kudos