Hello LUCD,
Thank you for your availability.
Yes I actually put the code as follows:
"
$vm = Get-VM "$Name$_"
while ($vm.PowerState -ne "PoweredOn"){ sleep 5
$vm = Get-VM $vm
}"
But it does not work, I get the following error: "Get-VM: Can not validate argument on parameter 'Name'. Argument is null The gold empty."
The code is there in the right place in the script ?
Thanks you.