
UNSOLVED
DB
DELL-Bill Gr
50 Posts
0
17203
November 21st, 2011 11:00
Powershell - Add-PSSnapin for Scripting
This post has been copied from the former Compellent User Forum and placed here for your reference. This code is made available AS IS, without warranty of any kind. The entire risk of the use or the results from the use of this code remains with the user.
Add-PSSnapin for Scripting – Originally posted By chaffees, 09 May 2011
chaffees - Cheers All!
In short I am running into the issue where if I run my script without manually adding the Compellent Add-PSSnapin the script will fail. I have a simple task that needs to run take a replay of a volume. When I run the powershell command(s) from the powershell command prompt it works fine (after of course running Add-PSSnapin Compellent.StorageCenter.PSSnapin). But if i were to add this to the script it will not load the snapins making my replay not occur.
Does anyone know how to get the cmdlets installed so a script that needs to use them?
pongowongo - If I understand your post correctly, you are looking for a way to programically add the Compellent snapin to your script, so that when you try and call a Compellent cmdlet, it doesn't bomb. If this is the case, you can take a look at my script I had posted previously, and at the begining is code to check to see if the Compellent Snapin is loaded, and if it's not, it will add the snap-in.
https://customer.compellent.com/forums/forum_posts.asp?TID=278
Responses (0)
Solutions (0)
