Search Results for

    Show / Hide Table of Contents

    Add-PnPSiteScript

    SYNOPSIS

    Required Permissions

    • SharePoint: Access to the SharePoint Tenant Administration site

    Creates a new Site Script on the current tenant

    SYNTAX

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

    DESCRIPTION

    Allows to add a Site Script on the current tenant.

    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

    -Confirm

    Prompts you for confirmation before running the cmdlet.

    Type: SwitchParameter
    Parameter Sets: (All)
    Aliases: cf
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -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: PnPConnection
    Parameter Sets: (All)
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -Content

    A JSON string containing the site script. See https://learn.microsoft.com/sharepoint/dev/declarative-customization/site-design-json-schema for documentation on how to create such a JSON schema.

    Type: String
    Parameter Sets: (All)
    
    Required: True
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -Description

    The description of the site script

    Type: String
    Parameter Sets: (All)
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -Title

    The title of the site script

    Type: String
    Parameter Sets: (All)
    
    Required: True
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -WhatIf

    Shows what would happen if the cmdlet runs. The cmdlet is not run.

    Type: SwitchParameter
    Parameter Sets: (All)
    Aliases: wi
    
    Required: False
    Position: Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    

    RELATED LINKS

    Microsoft 365 Patterns and Practices

    Back to top Generated by DocFX spacer