impact/Sync-ImpactWallpaper.ps1
function Sync-ImpactWallpaper { If (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { $LastMod = "C:\Windows\Personalization\lastmod" $WallpaperHeaders = Invoke-WebRequest -Method HEAD -Uri https://impactpartnership.blob.core.windows.net/public-resources/Wallpaper.png -UseBasicParsing | Select -Property Headers -ExpandProperty Headers IF ($WallpaperHeaders.'Last-Modified' -ne (Get-Content $LastMod -ErrorAction SilentlyContinue)) { Set-Content -Path $LastMod -Value $WallpaperHeaders.'Last-Modified' Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP -Name * Write-Host "Newer Wallpaper Ready! Setting for download. It'll appear soon!" -foregroundColor Green } ELSE { Write-Host "No Update Needed..." } } else { Write-Host "This Impact Partnership command requires elevation." -ForegroundColor Red } } |