Each time I search here for script solutions:
LucD posts the solution and also this time You were right. I installed the 5.1 R2 and the cmldet works. Thank You
Regarding possible other problems:
I have 2 maintaine VMs to run powercli scripts etc . The mainscript VM still has the 4.0 version installed and the other one the 5.1 R2
so i can figure out problems and compare.