Living a SharePoint life

Wednesday, January 21, 2015

Code Snippet: Load the SharePoint PowerShell Module

How do you load the PowerShell module for SharePoint?

Addendum: I've added a try/catch block to the code. This way you can be sure the module is loaded.

# Loading SharePoint Module
try {
    if ((Get-PSSnapin "microsoft.SharePoint.Powershell" -ea silentlycontinue) -eq $null)
        Add-PSSNapin Microsoft.SharePoint.Powershell
catch {
    throw "Microsoft SharePoint PowerShell AddIn initialization failed"
    exit 3


  1. Addendum: I've added a try/catch block to the code. This way you can be sure the module is loaded.Our site

  2. Thanks so much for sharing this awesome info! I am looking forward to see more posts from you! Check This Out.

  3. Wow what a Great Information about World Day its incredibly charming instructive post. an obligation of appreciation is all together for the post More about the author.

  4. Some times its a pain in the ass to read what blog owners wrote but this website is really user pleasant! . Check This Out

  5. Thankyou for this post, I am a big big fan of this site would like to go along updated. More about the author

  6. Thank you very much for writing such an interesting article on this topic. This has really made me think and I hope to read more.
    click over here

  7. Download TUrbo VPN for Windows PC and Mac Free Here

  8. Wow, this post is nice, my younger sister is analyzing such things, therefore I am going to let know her
    website: prediksi togel sydney

  9. Get more and more knowledge about Apps and technology on


Note: Only a member of this blog may post a comment.

Featured Post

The Retro Powershell - Looking good in 8-Bit | Part 1

I wrote a little script that, when placed in your PowerShell Profile, will print a message similar to the old boot message you got from you...