Get a kernel dump of a 2012 R2 Hyper-V server with Powershell

Jeff here,

There is a new Powershell command that you can use to get a kernel dump of a VM in Server 2012 R2. The cmdlet injects a non-maskable
interrupt into the VM. (This is an old method of getting a kernel dump, paper clip jammed in the ISA bus, anyone?) Since the NMI is sent from a remote
machine, this is perfect for getting a dump when you aren’t logged in, while debugging a credential provider perhaps.

 

By default Windows is setup to crash when it receives an NMI, the only thing you would have to change is the type of dump you want
written.

 The command is:

    PS C:\Windows\system32> Debug-VM -Name "VM Name" -InjectNonMaskableInterrupt -ComputerName Hostname