I sat on the New Desktop button in the task view switcher with my big beautiful ...

@Tamasg@mindly.social

I sat on the New Desktop button in the task view switcher with my big beautiful buttocks. It now opened 189 desktops. How did I close all of em?
Add-Type -TypeDefinition 'using System; using System.Runtime.InteropServices; public class KeySim { [DllImport("user32.dll")] public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo); public static void CloseDesktop() { keybd_event(0x5B,0,0,UIntPtr.Zero); keybd_event(0x11,0,0,UIntPtr.Zero); keybd_event(0x73,0,0,UIntPtr.Zero); keybd_event(0x73,0,2,UIntPtr.Zero); keybd_event(0x11,0,2,UIntPtr.Zero); keybd_event(0x5B,0,2,UIntPtr.Zero); } }'; 1..190 | ForEach-Object { [KeySim]::CloseDesktop(); Start-Sleep -Milliseconds 50 }