Moderator: Thread moved to the PowerCLI area.
You could do something like this$esx = Get-VMHost
$nameArr = @('test')
$nameArr += $esx.Name.split('.')[2..3]
Get-VMHostNetwork -VMHost $esx |
Set-VMHostNetwork -HostName ($nameArr -join '-')Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz1 person found this helpful
it works ,thanks for helping me!