I have a group of PowerShell scripts that sometimes run together, sometimes one at a time. Each script requires the loading of a specific snap-in.
Currently, each script calls Add-PSSnapin XYZ at the beginning.
Now, if I run several scripts on the back of the following throw scripts:
You cannot add the Windows PowerShell XYZ snap-in because it is added. Check the snap-in name and try again.
How can I do each script check to check if the snap-in is loaded before calling Add-PSSnapin?
powershell
joshuapoehls Sep 25 '09 at 15:28 2009-09-25 15:28
source share