Por favor, leia esta postagem do StackOverflow sobre a declaração 'return'. Aqui está o resumo:
Return: This will return to the previous call point. If you call this command from a script (outside any functions) it will return to the shell. If you call this command from the shell it will return to the shell (which is the previous call point for a single command ran from the shell). If you call this command from a function it will return to where ever the function was called from.
Execution of any commands after the call point that it is returned to will continue from that point. If a script is called from the shell and it contains the Return command outside any functions then when it returns to the shell there are no more commands to run thus making a Return used in this way essentially the same as Exit.
Então, você tem que remover a declaração de retorno do seu 'if' e 'else' , deixando apenas a variável para exibir seu conteúdo.
Exemplo:
if ($OddEvnResult -eq "Odd")
{
write-host "Odd number in hostname detected (1,3,5..etc). Setting storage path to" $oddStrgPath
#set-vmhost -VirtualHardDiskPath $oddStrgPath -VirtualMachinePath $oddStrgPath
$OEresult= $oddStrgPath
$OEresult
}
else
{
write-host "Even number in hostname detected (2,4,6..etc). Setting storage path to" $evnStrgPath
#set-vmhost -VirtualHardDiskPath $evnStrgPath -VirtualMachinePath $oddStrgPath
$OEresult= $evnStrgPath
$OEresult
}