Pnp-powershell: Set-PnPTheme -ColorPaletteUrl needs Server Relative URL instead of Site Relative URL for SharePoint Online

Created on 9 Feb 2018  路  3Comments  路  Source: pnp/PnP-PowerShell

Reporting an Issue or Missing Feature

Set-PnPTheme -ColorPaletteUrl documentation and help states that it should be using the Site Relative URL.

When running Get-PnPTheme, the result shows the Server Relative URL for the color file:

ColorFile : /sites/sharepoint/_catalogs/theme/15/spdarkblue.spcolor

I instead used the Server Relative URL and was able to update the color file as expected
set-pnptheme -colorpaletteurl /sites/team site/_catalogs/theme/15/NewColor.spcolor

Expected behavior

Per the written documentation and guidelines, when using the site relative URL, it should update the color palette that is being used.

Actual behavior

No new color palette is being issued, it appears to be resetting to default color palette

Steps to reproduce behavior

Using Set-PnPTheme -ColorPaletteUrl /siterelativeURL/colorfile.spcolor

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [x] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

2.23.18 SharePointPnPPowerShellOnline

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
  • [x] Installed through the PowerShell Gallery with Install-Module
  • [ ] Other means

Most helpful comment

Hi Eric,

Thank you for reporting this. Indeed, that cmdlet was in dear need of a fix up. I've merged the fix into the dev branch

All 3 comments

Same thing here :
image

Would be great if something was done, wether it's updating the code, or the documentation...

Hi Eric,

Thank you for reporting this. Indeed, that cmdlet was in dear need of a fix up. I've merged the fix into the dev branch

Hi Erin,

Setting the site background image has stopped working sometime since 2.22.1801.0.

I've had to roll back to use the following command:

Set-PnPTheme -BackgroundImageUrl /sites/_SiteAlias_/SiteAssets/SiteBackground.jpg

The command is accepted in the later version without error but the background image isn't applied.

Was this page helpful?
0 / 5 - 0 ratings