I am trying to use PowerShell script to set windows wallpaper. I learned it from Script to change wallpaper in windows 10? :
Function Set-WallPaper($Value)
{
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $value
rundll32.exe user32.dll, UpdatePerUserSystemParameters
}
Set-WallPaper -value 'c:\Temp\wallpaper.png'
Unfortunately it works only if Settings -> Personalization -> Background is already set to "Picture". It doesn't switch from "Solid Color". Is there a way to extend the script, so it switches from "Solid Color" to "Picture", too?