-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindows
More file actions
26 lines (20 loc) · 839 Bytes
/
windows
File metadata and controls
26 lines (20 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Set image location variable
$img = "$env:TEMP\youvebeenbiebered.jpg"
# Download random image
Invoke-WebRequest 'https://bieber.party/today' -OutFile $img
# Always use Stretch style
$WallpaperStyle = "2"
$TileWallpaper = "0"
# Set background styles
New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WallpaperStyle -PropertyType String -Value $WallpaperStyle -Force
New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name TileWallpaper -PropertyType String -Value $TileWallpaper -Force
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class NativeMethods {
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
}
"@
# Apply background
[NativeMethods]::SystemParametersInfo(20, 0, $img, 3)