Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 228891

Re: How to pass parameters in a variable in a loop FOREACH ?

$
0
0

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.


Viewing all articles
Browse latest Browse all 228891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>