From de6c36f321fd2a135f6d9ed2e8cc7506efdf82f4 Mon Sep 17 00:00:00 2001 From: Anthony Rose Date: Fri, 31 Jan 2025 15:38:05 +0000 Subject: [PATCH] Add script to remove Windows wallpaper --- roles/home-gui/files/Remove-Wallpaper.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 roles/home-gui/files/Remove-Wallpaper.ps1 diff --git a/roles/home-gui/files/Remove-Wallpaper.ps1 b/roles/home-gui/files/Remove-Wallpaper.ps1 new file mode 100644 index 0000000..d75bacd --- /dev/null +++ b/roles/home-gui/files/Remove-Wallpaper.ps1 @@ -0,0 +1,15 @@ +$W32Wallpaper = @' +using System.Runtime.InteropServices; +namespace Win32{ + public class Wallpaper{ + [DllImport("user32.dll", CharSet=CharSet.Auto)] + static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni); + public static void SetWallpaper(string thePath){ + SystemParametersInfo(20,0,thePath,3); + } + } +} +'@ +Add-Type $W32Wallpaper + +[Win32.Wallpaper]::SetWallpaper([string]::Empty)