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?
Could you be connected twice? I would make sure I fully disconnect from everything, then log back in and run the command again.
that was the first thing I thought of, I disconnected all connections, retried only to get same results
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
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.
Stupid question, but you did stop/start your PowerCLI session in between ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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.