Add-PnPSiteScript

Creates a new Site Script on the current tenant.

Syntax

Add-PnPSiteScript
   -Title <String>
                    -Content <String>
                    [-Description <String>]
                    [-Connection <SPOnlineConnection>]

Examples

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

Add-PnPSiteScript -Title "My Site Script" -Description "A more detailed description" -Content $script

Adds a new Site Script, where $script variable contains the script.

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
-Content

A JSON string containing the site script

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Description

The description of the site script

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Title

The title of the site script

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False