powershell SNIP | VMware - VM - 重命名VM

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell SNIP | VMware - VM - 重命名VM相关的知识,希望对你有一定的参考价值。

#VMs that are only lowercase
get-vm | ? Name -cmatch '^[a-z0-9]*$' |%{ Set-VM -VM $_ -Name $_.Name.ToUpper() -Confirm:$False}

#VMs that are anything except uppercase (and templates, and vROps)
get-vm | ? Name -cnotmatch '^[A-Z0-9]*$' |?{$_.Name -notlike "w2k*" -and $_.Name -notlike "*TMP_*" -and $_.Name -notlike "vROps"} |%{ Set-VM -VM $_ -Name $_.Name.ToUpper() -Confirm:$False}

以上是关于powershell SNIP | VMware - VM - 重命名VM的主要内容,如果未能解决你的问题,请参考以下文章