Created
September 24, 2014 21:09
-
-
Save vgrem/e00da5f4f5dd847943d0 to your computer and use it in GitHub Desktop.
Enable jQuery in Office 365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string]$SiteUrl, | |
[string]$UserName, | |
[string]$Password | |
) | |
. ".\UserCustomActions.ps1" | |
<# | |
.SYNOPSIS | |
Enable jQuery Library | |
.DESCRIPTION | |
Enable jQuery Library in Office 365/SharePoint Online site | |
.EXAMPLE | |
.\Activate-JQuery.ps1 -SiteUrl "https://tenant-public.sharepoint.com" -UserName "username@tenant.onmicrosoft.com" -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 | |
$context.Dispose() | |
} | |
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