external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Adds a link to a JavaScript file to a web or sitecollection
Add-PnPJavaScriptLink -Name <String>
-Url <String[]>
[-Sequence <Int>]
[-Scope <CustomActionScope>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Creates a custom action that refers to a JavaScript file
PS:> Add-PnPJavaScriptLink -Name jQuery -Url https://code.jquery.com/jquery.min.js -Sequence 9999 -Scope Site
Injects a reference to the latest v1 series jQuery library to all pages within the current site collection under the name jQuery and at order 9999
PS:> Add-PnPJavaScriptLink -Name jQuery -Url https://code.jquery.com/jquery.min.js
Injects a reference to the latest v1 series jQuery library to all pages within the current web under the name jQuery
Name under which to register the JavaScriptLink
Type: String
Parameter Sets: (All)
Aliases: Key
Required: True
Position: Named
Accept pipeline input: False
Defines if this JavaScript file will be injected to every page within the current site collection or web. All is not allowed in for this command. Default is web.
Type: CustomActionScope
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Sequence of this JavaScript being injected. Use when you have a specific sequence with which to have JavaScript files being added to the page. I.e. jQuery library first and then jQueryUI.
Type: Int
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
URL to the JavaScript file to inject
Type: String[]
Parameter Sets: (All)
Required: True
Position: Named
Accept pipeline input: False
Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
Type: SPOnlineConnection
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.
Type: WebPipeBind
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False