Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Set-PnPWebTheme results in Unknown Error #4656

Open
1 of 6 tasks
pmolstad opened this issue Dec 27, 2024 · 0 comments
Open
1 of 6 tasks

[BUG]Set-PnPWebTheme results in Unknown Error #4656

pmolstad opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pmolstad
Copy link

pmolstad commented Dec 27, 2024

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Invoke-PnPSiteTemplate or Get-PnPSiteTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/powershell/tree/master/src/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/pnpframework/issues

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting
Just recently, we started having issues running Set-PnPWebTheme cmdlet after successfully running Invoke-PnPSiteTemplate. There have been no changes to our script which has successfully run in PowerShell 5 and 7 for over a year. The script now fails only on the Set-PnPWebTheme cmdlet which is reproducible outside of the script. We have an existing custom theme that is applied to all of our Communication sites at the time the site is created via an XML provisioning template. Only recently, do we now have to apply the existing theme manually via 'Change the look' since the cmdlet is no longer executing successfully. We have found that the cmdlet successfully applies out of the box themes like 'Teal' but fails to apply our existing custom theme as it has done successfully in the past.

Expected behavior

Please describe what output you expect to see from the PnP PowerShell Cmdlets
As in the past, the expectation is no error message with the existing theme applied to the newly created site.

Actual behavior

Please describe what you see instead. Please provide samples of output or screenshots.
The script fails displaying the following message and the existing theme is not applied.

Set-PnPWebTheme : Unknown Error
At line:3 char:1

  • Set-PnPWebTheme -Theme $theme -WebUrl $site
  •   + CategoryInfo          : InvalidOperation: (:) [Set-PnPWebTheme], PSInvalidOperationException
      + FullyQualifiedErrorId : InvalidOperation,PnP.PowerShell.Commands.Branding.SetWebTheme
    
    

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists
https://gist.github.com/pmolstad/cb6999dde1a87fc59b12c2a738eb877a#file-applyexistingcustomtheme-ps1

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

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)
PowerShell 5 - version 1.12.0 (Core,Desk)
PowerShell 7 - version 2.12.0 (Core) / version 2.4.0 (Desk)

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@pmolstad pmolstad added the bug Something isn't working label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant