Joseph Daly
asked on
Calling sharepoint powerhsell module from a PS1 file
I have created a ps1 file that i want to use to automate the creation of sharepoint 2010 sites etc. The commands themselves work fine when entered through the sharepoint powershell management module, however when i save my commands as a PS1 file and try to execute them I get errors that the commands dont exist.
I know this is due to the differences between the standard powershell and the sharepoint powershell modules. I think I need to call the sharepoint module at the beginning of my PS1 script but I dont know how to do this.
I know this is due to the differences between the standard powershell and the sharepoint powershell modules. I think I need to call the sharepoint module at the beginning of my PS1 script but I dont know how to do this.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
makes sense.
Try adding this to the beginning of your script:
Add-PSSNapin Microsoft.SharePoint.Power Shell
Try adding this to the beginning of your script:
Add-PSSNapin Microsoft.SharePoint.Power
ASKER
I think that did it. Thanks
ASKER
Thanks
ASKER