Add-SPO error on custom theme

DB Shottie907 21 Reputation points
2021-03-11T01:47:02.367+00:00

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.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,600 questions
0 comments No comments
{count} votes

Accepted answer
  1. Allen Xu_MSFT 13,776 Reputation points
    2021-03-11T06:14:55.893+00:00

    Hi @DB Shottie907 ,

    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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. DB Shottie907 21 Reputation points
    2021-03-11T12:05:47.39+00:00

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

    0 comments No comments