Self destructing Wallpaper changer

TL;DR

A powershell script that downloads an image, changes the Windows wallpaper to that file and deletes the image and itself. The background is cached by Windows and will survive the source-file purge.

Sourcecode:

Invoke-WebRequest "https://cdn.pixabay.com/photo/2016/10/12/11/32/hacking-1734225_960_720.jpg" -OutFile wallpaper.png
$image = (Get-Item -Path ".\").FullName + "\wallpaper.png"
Add-Type -TypeDefinition @'
using System;
using System.Runtime.InteropServices;
public class Params
{
   [DllImport("User32.dll",CharSet=CharSet.Unicode)]
   public static extern int SystemParametersInfo (Int32 uAction,
     Int32 uParam,
     String lpvParam,
     Int32 fuWinIni);
}
'@
$SPI_SETDESKWALLPAPER = 0x0014
$UpdateIniFile = 0x01
$SendChangeEvent = 0x02
$fWinIni = $UpdateIniFile -bor $SendChangeEvent
$ret = [Params]::SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, $Image, $fWinIni)
Remove-Item -LiteralPath $MyInvocation.MyCommand.Path + "/wallaper.png" -Force
Remove-Item -LiteralPath $MyInvocation.PSCommandPath -Force

Explained: