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

Re: PowerCLI: Exception calling "CreateCollectorForTasks" with "1" argument(s): "The operation is not allowed in the current state."

$
0
0

I don't immediatly see a reason why the wrong account would be picked.

But I would start by changing this

...
foreach ($vm in $myVMs)
$snapshots = Get-Snapshot -VM $vm
    foreach ($snapShot in $snapShots){
        $VM = $snapShot.VM
        .....
You seem to overwriting the loop variable inside the loop.
Although this is technically allowed, and could be useful in some situations, I would suggest to change 1 of the 2 variables to another name.
Just to avoid potential problems with the $vm variable

Viewing all articles
Browse latest Browse all 236824

Trending Articles



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