Loading SharePoint Snap-In

suggest change

Load the SharePoint snap-in with:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

This works only in 64-bit Windows PowerShell. Snap-ins are not available in PowerShell 7. If the window title says “Windows PowerShell (x86)”, you are in the 32-bit host.

If the snap-in is already loaded, Add-PSSnapin errors. Load it only when it is missing:

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

Alternatively, if you start the SharePoint Management Shell, it will automatically include the Snap-In.

To list the SharePoint cmdlets:

Get-Command -Module Microsoft.SharePoint.PowerShell

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents