Highlighted
Enthusiast
Enthusiast

getting duplicate results

I am having an interesting issue with a windows system that I run alot of my powershell/powercli code from.

when I run scripts to report lets say the results of which vms have snapshots. the report returns with each vm duplicating. I know there is nothing wrong with the code. it is simple code and works just fine when I run from other windows systems.   Any ideas why this would happen?

0 Kudos
6 Replies
Highlighted
Hot Shot
Hot Shot

Could you be connected twice?  I would make sure I fully disconnect from everything, then log back in and run the command again.

0 Kudos
Highlighted
Enthusiast
Enthusiast

that was the first thing I thought of, I disconnected all connections, retried only to get same results

0 Kudos
Highlighted
User Moderator
User Moderator

Did you also check what is in the variable $global:defaultviservers after you ran the script ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Enthusiast
Enthusiast

no.. ill check....., and also it is not only my scripts.. if I just do a : get-vm <vmname> |get-snapshot on a vm with one snap, it will show the same thing twice.. alternately, if I run the same command from another windows system(s). I get the expected results.

0 Kudos
Highlighted
User Moderator
User Moderator

Stupid question, but you did stop/start your PowerCLI session in between ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Enthusiast
Enthusiast

there is no stupid questions when it comes to my skills in powershell/powercli :smileylaugh:... But the answer is no.

BUT, I just rebooted my windows server, once I did that, the duplication went away. I'm now scared it will return though. if it does it can really impact some of my scripts.

0 Kudos