question

JamesSharman-6563 avatar image
0 Votes"
JamesSharman-6563 asked ·

Add-SPO error on custom theme

Hi, I'm trying to add a custom color theme to a corporate SharePoint Online environment. Following a couple of YouTube videos led me to the code below. However, when I run using PowerShell IDE or SharePoint Online Management Shell I get the following error:
Add-SPOTheme : A positional parameter cannot be found that accepts argument 'Corporate Blue'.

 $themeName = "Corporate Blue"
    
 $corppalette = @{
 "themePrimary" = "#00547e";
 "themeLighterAlt" = "#000305";
 "themeLighter" = "#000d14";
 "themeLight" = "#001925";
 "themeTertiary" = "#00324b";
 "themeSecondary" = "#00496e";
 "themeDarkAlt" = "#0e618a";
 "themeDark" = "#25759c";
 "themeDarker" = "#5094b6";
 "neutralLighterAlt" = "#f8f8f8";
 "neutralLighter" = "#f4f4f4";
 "neutralLight" = "#eaeaea";
 "neutralQuaternaryAlt" = "#dadada";
 "neutralQuaternary" = "#d0d0d0";
 "neutralTertiaryAlt" = "#c8c8c8";
 "neutralTertiary" = "#595959";
 "neutralSecondary" = "#373737";
 "neutralPrimaryAlt" = "#2f2f2f";
 "neutralPrimary" = "#000000";
 "neutralDark" = "#151515";
 "black" = "#0b0b0b";
 "white" = "#ffffff";
 }
    
 Add-SPOTheme -Name = $themeName -Palette $corppalette -IsInverted:$false -Overwrite


I'm signed in as a SharePoint Admin. Thanks in advance for any advice.

office-sharepoint-online
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered ·

Hi @JamesSharman-6563,

Please cut " = " after the parameter "-Name" and update the command like below:

 Add-SPOTheme -Name $themeName -Palette $corppalette -IsInverted:$false -Overwrite

This can be execute successfully in my end as per my test, and the new theme can be apply to my tenant also.
76643-image.png
76578-image.png


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (20.2 KiB)
image.png (8.3 KiB)
·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JamesSharman-6563 avatar image
0 Votes"
JamesSharman-6563 answered ·

Thanks @AllenXu-MSFT , you're absolutely right of course. I can't believe I missed that one - thank you kindly!

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.