I have a script which is visible in the screenshot and I don't know why the values in $vmlist cannot be accessed.
I'm creating the list, then foreach"ing" them, but running a command against them is erroring out on each loop.
HyperVisor cannot find machine name. I can assure you the machine names are correct.
I think it's a result of the Type of list created for $vmList (ie.. not true text...??)
$vmlist=Get-VM | Where State -eq Running | Select Name if ($vmlist) { foreach ($vmname in $vmlist) { Stop-VM -name $vmname }}
Can anyone help?