I am trying to apply a custom theme color to my SharePoint online site from an article I got online. Im running it in SharePoint online Management shell. I have the latest version of SPO management shell, it shows:
vti_encoding:SR|utf8-nl
vti_extenderversion:SR|16.0.0.12003
I've run the: Install-Module SharePointPnPPowerShellOnline cmd line
I've also run the following: Set-ExecutionPolicy RemoteSigned -Force
but I get the following error:
Connect-SPOService : The term 'Connect-SPOService' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
AND
Add-SPOTheme : The term 'Add-SPOTheme' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
My script looks like this:
$SPThemeName = "My Custom colors"
$SPThemePalette = const myTheme = @{
"themePrimary" = "#5d5daf";
"themeLighterAlt" = "#f7f7fc";
"themeLighter" = "#e0e0f2";
"themeLight" = "#c7c7e7";
"themeTertiary" = "#9595d0";
"themeSecondary" = "#6d6db9";
"themeDarkAlt" = "#54549e";
"themeDark" = "#474786";
"themeDarker" = "#343463";
"neutralLighterAlt" = "#faf9f8";
"neutralLighter" = "#f3f2f1";
"neutralLight" = "#edebe9";
"neutralQuaternaryAlt" = "#e1dfdd";
"neutralQuaternary" = "#d0d0d0";
"neutralTertiaryAlt" = "#c8c6c4"; "neutralTertiary" = "#a19f9d"; "neutralSecondary" = "#605e5c"; "neutralSecondaryAlt" = "#8a8886"; "neutralPrimaryAlt" = "#3b3a39"; "neutralPrimary" = "#323130"; "neutralDark" = "#201f1e"; "black" = "#000000"; "white" = "#ffffff"; }
Set-ExecutionPolicy RemoteSigned -Force
cls
if(Get-module -ListAvailable -Name "Microsoft.Online.SharePoint.PowerShell") {
Write-Host "SharePoint Online module already installed" -ForegroundColor Green
}
else {
Write-Host "Installing latest version of SharePoint Online module" -ForegroundColor Yellow
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Force
}
Connect-SPOService -Url <myURL> -credential <myUsername>
Add-SPOTheme -Identity $SPThemeName -Palette $SPThemePalette -IsInverted $false
Write-Host "Your Fluent UI Theme '"$SPThemeName "' is now added to SharePoint.`n Go to a web site and Change the Look." -ForegroundColor Green
Set-ExecutionPolicy Default -Force
Import-Module -Name Microsoft.Online.SharePoint.PowerShell - It says it is already installed
I'm running this in Windows Powershell ISE with admin privileges. I'm importing the SharePoint Online Man module, but it still tells me the term Connect-SPOService and Add-SPOTheme is not recognized
Please Help?
16.0.23408.12000
. let me know if this works for you.