Remove-PnPJavaScriptLink

Removes a JavaScript link or block from a web or sitecollection

Syntax

Remove-PnPJavaScriptLink
      [-Identity <UserCustomActionPipeBind>]
                              [-Force [<SwitchParameter>]]
                              [-Scope <CustomActionScope>]
                              [-Web <WebPipeBind>]
                              [-Connection <SPOnlineConnection>]

Examples

------------------EXAMPLE 1------------------

Remove-PnPJavaScriptLink -Identity jQuery

Removes the injected JavaScript file with the name jQuery from the current web after confirmation

------------------EXAMPLE 2------------------

Remove-PnPJavaScriptLink -Identity jQuery -Scope Site

Removes the injected JavaScript file with the name jQuery from the current site collection after confirmation

------------------EXAMPLE 3------------------

Remove-PnPJavaScriptLink -Identity jQuery -Scope Site -Confirm:$false

Removes the injected JavaScript file with the name jQuery from the current site collection and will not ask for confirmation

------------------EXAMPLE 4------------------

Remove-PnPJavaScriptLink -Scope Site

Removes all the injected JavaScript files from the current site collection after confirmation for each of them

------------------EXAMPLE 5------------------

Remove-PnPJavaScriptLink -Identity faea0ce2-f0c2-4d45-a4dc-73898f3c2f2e -Scope All

Removes the injected JavaScript file with id faea0ce2-f0c2-4d45-a4dc-73898f3c2f2e from both the Web and Site scopes

------------------EXAMPLE 6------------------

Get-PnPJavaScriptLink -Scope All | ? Sequence -gt 1000 | Remove-PnPJavaScriptLink

Removes all the injected JavaScript files from both the Web and Site scope that have a sequence number higher than 1000

Parameters

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Force

Use the -Force flag to bypass the confirmation question

Type:SwitchParameter
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Identity

Name or id of the JavaScriptLink to remove. Omit if you want to remove all JavaScript Links.

Type:UserCustomActionPipeBind
Aliases:Key, Name
Position:0
Accept pipeline input:True
Accept wildcard characters:False
-Scope

Define if the JavaScriptLink is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection.

Type:CustomActionScope
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Web

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
Position:Named
Accept pipeline input:False
Accept wildcard characters:False