Skip to content

Instantly share code, notes, and snippets.

@sjkp
Created April 19, 2015 08:11
Show Gist options
  • Save sjkp/035d4c1bd05d0ba9c079 to your computer and use it in GitHub Desktop.
Save sjkp/035d4c1bd05d0ba9c079 to your computer and use it in GitHub Desktop.
Enable Side Loading of Apps
[System.Reflection.Assembly]::LoadFile("C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll")
$ctx = new-object Microsoft.SharePoint.Client.ClientContext("https://<site>")
$pass = "<password>"
$s = ConvertTo-SecureString -String $pass -AsPlainText -Force
$ctx.Credentials = new-object Microsoft.SharePoint.Client.SharePointOnlineCredentials("DemoAdmin@DelegateDemo01.onmicrosoft.com",$s)
$ctx.Load($ctx.Site);
$ctx.ExecuteQuery();
$guid = [System.Guid]"e374875e-06b6-11e0-b0fa-57f5dfd72085"
$ctx.Site.Features.Add($guid,$true,[Microsoft.SharePoint.Client.FeatureDefinitionScope]::None)
$ctx.ExecuteQuery();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment