VMware Cloud Community
drivera01
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?

Reply
0 Kudos
6 Replies
DZ1
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.

Reply
0 Kudos
drivera01
Enthusiast
Enthusiast

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

Reply
0 Kudos
LucD
Leadership
Leadership

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

Reply
0 Kudos
drivera01
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.

Reply
0 Kudos
LucD
Leadership
Leadership

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


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

Reply
0 Kudos
drivera01
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.

Reply
0 Kudos