It was an extract method refactoring, this code has not been written from scratch .Issue is beyong trailing slash, VhdName generation code is repeated several times in New-AzureVM and New-AzureQuickVM code. I'll fix it in the next release. 

Opened the following issue #1326.