Skyline NPM PowerShell Scripts for SharePoint
npm install skyline-sppowershellpowershell
Add-SkylineContentEditorWebPart [-Title] [-ContentLink] [[-Description] ] [[-Group] ] [[-FileName] ] [[-Web] ] []
`
DESCRIPTION
Uploads a content editor webpart to the Web Part Gallery
PARAMETERS
$3
Name of the webpart
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Absolute path of of the Content Link property
Example: "https://site.sharepoint.com/style library/webparts/widget1.html"
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Description of the webpart
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Group which the webpart should belong to. Default is 'Custom'
`
Required? false
Position? 4
Default value Custom
Accept pipeline input? false
Accept wildcard characters? false
`
$3
File name of the webpart file that gets uploaded to the web part gallery.
File extension will be added if not included.
Default is Title parameter with .dwp extension (e.g. -Title "MyWebPart" becomes -FileName "MyWebPart.dwp")
`
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Add new content editor web part with the group 'Intranet' and content link 'https://site.sharepoint.com/style library/webparts/widget1.html'
Add-SkylineContentEditorWebPart -Title "Widget1" -Description "The best widget" -Group "Intranet" -ContentLink "https://site.sharepoint.com/style library/webparts/widget1.html"
`
Add-SkylineCSSLinkCustomAction
SYNOPSIS
Adds a script block custom action which loads the specified CSS url on the page
SYNTAX
`powershell
Add-SkylineCSSLinkCustomAction [-Name] [-Url] [[-Sequence] ] [[-Scope] ] [-HideBodyOnLoad] [[-Web] ] []
`
DESCRIPTION
Adds a script block custom action which loads the specified CSS url on the page
PARAMETERS
$3
Name of the CSS link custom action
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Absolute path of of the CSS Link
Example: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
A sequence number that defines the order on the page, defaults to 100
`
Required? false
Position? 3
Default value 100
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The scope of the script to add to. Either Web or Site, defaults to Site
`
Required? false
Position? 4
Default value Site
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Optionally hide tag via opacity:0 while the css url is being loaded to prevent jarring user experience
`
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Add bootstrap CSS to every page in the site collection
Add-SkylineCSSLinkCustomAction -Name "BootstrapCss" -Url "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
`
Add-SkylineFieldIndex
SYNOPSIS
Sets a SharePoint list field to be indexed
SYNTAX
`powershell
Add-SkylineFieldIndex [-Identity] [-List] [[-Web] ] []
`
DESCRIPTION
Sets a SharePoint list field to be indexed
PARAMETERS
$3
Name of the field to update
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Display name of the list which contains the field
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Set the Title field on the Announcements list to be indexed
Add-SkylineFieldIndex -Identity "Title" -List "Announcements"
`
$3
`powershell
PS C:\>Set the Title field on the Announcements list to be indexed on a specific Web which may not be the currently connected web
Add-SkylineFieldIndex -Identity "Title" -List "Announcements" -Web $Subweb
`
Add-SkylineFiles
SYNOPSIS
Uploads multiple files and folders from a local path to a remote site
SYNTAX
`powershell
Add-SkylineFiles [-Path] [-Folder] [[-Includes] ] [[-Excludes] ] [-Recurse] [-Checkout] [[-CheckInComment] ] [-Approve] [[-ApproveComment] ] [-Publish] [[-PublishComment] ] [-UseWebDav] [[-Web] ] []
`
DESCRIPTION
Uploads multiple files and folders from a local path to a remote site
PARAMETERS
$3
Local path to folder containing files to upload
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Remote site-relative folder to upload files into
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Array of wildcard-like strings which are matched against local file paths and included in upload.
When -Includes is specified, everything else is excluded by default.
Example 1: -Includes ".js", ".css"
Example 2: -Includes "/dist/js/"
`
Required? false
Position? 3
Default value @()
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Array of wildcard-like strings which are matches against local files paths and excluded from upload.
When -Excludes is specified with an -Includes, the -Excludes will run after and exclude from the narrowed result set.
Example 1: -Excludes "/img/"
Example 2: -Excludes ".map"
`
Required? false
Position? 4
Default value @()
Accept pipeline input? false
Accept wildcard characters? false
`
$3
TRUE by default. Will recurively upload any subfolders found in the -Path directory.
Set -Recurse:$False to disable and only upload the files found in the -Path directory.
`
Required? false
Position? named
Default value True
Accept pipeline input? false
Accept wildcard characters? false
`
$3
If versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again.
`
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The comment added to the checkin.
`
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Will auto approve the uploaded file.
`
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The comment added to the approval.
`
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Will auto publish the file.
`
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The comment added to the publish action.
`
Required? false
Position? 7
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Use Web Dav for the upload.
`
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 8
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Add-SkylineFiles -Path C:\dev\app\dist -Folder "Style Library/app" -Includes ".js", ".css"
`
Add-SkylineScriptEditorWebPart
SYNOPSIS
Uploads a script editor webpart to the Web Part Gallery
SYNTAX
`powershell
Add-SkylineScriptEditorWebPart [-Title] [-Content] [[-Description] ] [[-Group] ] [[-FileName] ] [[-Web] ] []
`
DESCRIPTION
Uploads a script editor webpart to the Web Part Gallery
PARAMETERS
$3
Name of the webpart
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Script to include within the script editor web part
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Description of the webpart
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Group which the webpart should belong to. Default is 'Custom'
`
Required? false
Position? 4
Default value Custom
Accept pipeline input? false
Accept wildcard characters? false
`
$3
File name of the webpart file that gets uploaded to the web part gallery.
File extension will be added if not included.
Default is Title parameter with .webpart extension (e.g. -Title "MyWebPart" becomes -FileName "MyWebPart.webpart")
`
Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Add new script editor web part with the group 'Intranet' and javascript hello world alert
Add-SkylineScriptEditorWebPart -Title "Widget1" -Description "The best widget" -Group "Intranet" -Content ""
`
Add-SkylineWebPart
SYNOPSIS
Uploads a webpart file to the Web Part Gallery
SYNTAX
`powershell
Add-SkylineWebPart -Path [-Group ] [-Web ] []
Add-SkylineWebPart -Stream `
DESCRIPTION
Uploads a webpart file to the Web Part Gallery
PARAMETERS
$3
Local path to the webpart xml file
`
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Stream with the file contents
`
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Name of the webpart file when using a stream, be sure to include .dwp or .webpart (e.g. mywebpart.dwp)
`
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Group which the webpart should belong to. Default is 'Custom'
`
Required? false
Position? named
Default value Custom
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Uploads a webpart file from local machine to Web Part Gallery
Add-SkylineWebPart -Path "C:\Webparts\MyWebpart.dwp" -Group "Intranet"
`
Apply-SkylineSchemas
SYNOPSIS
Find all .xml files in a directory and applies them to a site
SYNTAX
`powershell
Apply-SkylineSchemas [-Directory] [[-Web] ] []
`
DESCRIPTION
Find all .xml files in a directory and applies them to a site
Reference: https://github.com/SharePoint/PnP-Provisioning-Schema
PARAMETERS
$3
Local directory where the XML files are located
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Save-SkylineListProvisioningSchema -Directory "C:\Schemas"
`
Get-SkylineCustomAction
SYNOPSIS
Gets all site and web scoped custom actions
SYNTAX
`powershell
Get-SkylineCustomAction [[-Name] ] [[-Web] ] []
`
DESCRIPTION
Gets all site and web scoped custom actions
PARAMETERS
$3
Name of the custom action to get, can be site or web scoped
`
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Get-SkylineCustomAction
`
$3
`powershell
PS C:\>Get-SkylineCustomAction -Name "SiteOrWebCustomAction"
`
$3
`powershell
PS C:\>Get-SkylineCustomAction -Web $Subweb
`
Get-SkylineExperience
SYNOPSIS
Gets the experience for a site collection or web
SYNTAX
`powershell
Get-SkylineExperience [-Scope] [[-Web] ] []
`
DESCRIPTION
Gets the experience for a site collection or web
PARAMETERS
$3
Specify whether to get the experience on the Web or Site
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Get-SkylineExperience -Scope Site
`
$3
`powershell
PS C:\>Get-SkylineExperience -Scope Web
`
Remove-SkylineFieldIndex
SYNOPSIS
Removes a SharePoint list field index
SYNTAX
`powershell
Remove-SkylineFieldIndex [-Identity] [-List] [[-Web] ] []
`
DESCRIPTION
Removes a SharePoint list field index
PARAMETERS
$3
Name of the field to update
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Display name of the list which contains the field
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Removes the Title field index on the Announcements list
Remove-SkylineFieldIndex -Identity "Title" -List "Announcements"
`
$3
`powershell
PS C:\>Removes the Title field index on the Announcements list on a specific Web which may not be the currently connected web
Remove-SkylineFieldIndex -Identity "Title" -List "Announcements" -Web $Subweb
`
Save-SkylineContentTypeSchema
SYNOPSIS
Extracts the PnP Provisioning Schema XML for the specific site content type(s)
SYNTAX
`powershell
Save-SkylineContentTypeSchema [-ContentType] [-Path] [[-Web] ] []
`
DESCRIPTION
Extracts the PnP Provisioning Schema XML for the specific site content type(s)
Reference: https://github.com/SharePoint/PnP-Provisioning-Schema
PARAMETERS
$3
Title of the target content type. May pass multiple content types as -ContentType "ContentType1", "ContentType2"
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Path to export the provisioning schema to. Example: C:\ProvisioningSchemas\ContentType1.xml
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Save-SkylineContentTypeSchema -ContentType "ContentType1" -Path "C:\ProvisioningSchemas\ContentType1.xml"
`
Save-SkylineFieldSchema
SYNOPSIS
Extracts the PnP Provisioning Schema XML for the specific site fields(s)
SYNTAX
`powershell
Save-SkylineFieldSchema [-Field] [-Path] [[-Web] ] []
`
DESCRIPTION
Extracts the PnP Provisioning Schema XML for the specific site fields(s)
Reference: https://github.com/SharePoint/PnP-Provisioning-Schema
PARAMETERS
$3
Title of the target field. May pass multiple fields as -ContentType "SiteField1", "SiteField1"
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Path to export the provisioning schema to. Example: C:\ProvisioningSchemas\SiteField1.xml
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Save-SkylineFieldSchema -Field "SiteField1" -Path "C:\ProvisioningSchemas\SiteField1.xml"
`
Save-SkylineListSchema
SYNOPSIS
Extracts the PnP Provisioning Schema XML for the specific list(s)
SYNTAX
`powershell
Save-SkylineListSchema [-List] [-Path] [[-Web] ] []
`
DESCRIPTION
Extracts the PnP Provisioning Schema XML for the specific list(s)
Reference: https://github.com/SharePoint/PnP-Provisioning-Schema
PARAMETERS
$3
Title of the target list. May pass multiple lists as -List "List1", "List2"
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Path to export the schema to. Example: C:\Schemas\Documents.xml
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Save-SkylineListProvisioningSchema -List "Documents" -Path "C:\Schemas\Documents.xml"
`
Save-SkylineTermSetSchema
SYNOPSIS
Extracts the PnP Provisioning Schema XML for the specific term group and term set
SYNTAX
`powershell
Save-SkylineTermSetSchema [-TermGroup] [-TermSet] [-Path] [[-Web] ] []
`
DESCRIPTION
Extracts the PnP Provisioning Schema XML for the specific term group and term set
Reference: https://github.com/SharePoint/PnP-Provisioning-Schema
PARAMETERS
$3
Name of the parent term group
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Name of the term set
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Path to export the schema to. Example: C:\Schemas\Terms.xml
`
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Save-SkylineListProvisioningSchema -TermGroup "Skyline" -TermSet "Departments" -Path "C:\Schemas\Terms.xml"
`
Set-SkylineExperience
SYNOPSIS
Sets the experience for a site collection or web to classic or modern
SYNTAX
`powershell
Set-SkylineExperience [-Mode] [-Scope] [[-Web] ] []
`
DESCRIPTION
Sets the experience for a site collection or web to classic or modern
PARAMETERS
$3
Specify Classic or Modern experience
`
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
Specify whether to apply the experience to the Web or Site
`
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
$3
The web to apply the command to. Omit this parameter to use the current web.
`
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
`
NOTES
EXAMPLES
$3
`powershell
PS C:\>Set-SkylineExperience -Mode Classic -Scope Site
`
$3
`powershell
PS C:\>Set-SkylineExperience -Mode Modern -Scope Web
``