Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enable jQuery in Office 365
. ".\UserCustomActions.ps1"
Enable jQuery Library
Enable jQuery Library in Office 365/SharePoint Online site
.\Activate-JQuery.ps1 -SiteUrl "" -UserName "" -Password "password"
Function Activate-JQuery([string]$SiteUrl,[string]$UserName,[string]$Password)
$context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
$context.Credentials = Get-SPOCredentials -UserName $UserName -Password $Password
$sequenceNo = 1482
$jQueryUrl = "~SiteCollection/Style Library/Scripts/jQuery/jquery-2.1.1.js"
Add-ScriptLinkAction -Context $Context -ScriptSrc $jQueryUrl -Sequence $sequenceNo
Activate-JQuery -SiteUrl $SiteUrl -UserName $UserName -Password $Password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment