Skip to content

Instantly share code, notes, and snippets.

@mikerodionov
Created June 26, 2018 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikerodionov/d0f82922f66190c7ad96f0a02d06476d to your computer and use it in GitHub Desktop.
Save mikerodionov/d0f82922f66190c7ad96f0a02d06476d to your computer and use it in GitHub Desktop.
Load SharePoint PS Module (if not already loaded)
#Load SharePoint PS Module (if not already loaded)
$ver = $host | select version
if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"}
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment