TommyOrr's avatar
TommyOrr
Copper Contributor
Jun 29, 2021
Status:
Closed

Pad Session host name with Leading Zeros

When adding session hosts to a pool you declare a prefix and the template will append an incrementing number to the end. but this number is not a consistent length due to the lack of leading zeros. and in large host pool, this causes the hosts to not sort properly 

CurrentExample of Bad SortDesired
Test-VM-1Test-VM-1Test-VM-001
Test-VM-2Test-VM-10Test-VM-002
Test-VM-3Test-VM-11Test-VM-003
Test-VM-4Test-VM-12Test-VM-004
Test-VM-5Test-VM-2Test-VM-005
Test-VM-6Test-VM-3Test-VM-006
Test-VM-7Test-VM-4Test-VM-007
Test-VM-8Test-VM-5Test-VM-008
Test-VM-9Test-VM-6Test-VM-009
Test-VM-10Test-VM-7Test-VM-010
Test-VM-11Test-VM-8Test-VM-011
Test-VM-12Test-VM-9Test-VM-012
No CommentsBe the first to comment