Added an idiot filter to Watch-BlueScreen

This commit is contained in:
Matt Graeber 2013-05-13 20:26:05 -04:00
parent 2a17b8fb56
commit a1cb7db1d0
1 changed files with 7 additions and 3 deletions

View File

@ -23,6 +23,7 @@
http://blog.cmpxchg8b.com/2013/02/the-other-integer-overflow.html http://blog.cmpxchg8b.com/2013/02/the-other-integer-overflow.html
https://twitter.com/NTarakanov/status/334031968465453057 https://twitter.com/NTarakanov/status/334031968465453057
#> #>
[CmdletBinding( ConfirmImpact = 'High')] Param ()
try { $Gdi32 = [Gdi32] } catch [Management.Automation.RuntimeException] try { $Gdi32 = [Gdi32] } catch [Management.Automation.RuntimeException]
{ {
@ -68,7 +69,10 @@
$LAYOUT_RTL = 1 $LAYOUT_RTL = 1
if ($psCmdlet.ShouldContinue( 'Do you want to continue?', 'You may want to save your work before continuing.' ))
{
$DC = $Gdi32::CreateCompatibleDC([IntPtr]::Zero) $DC = $Gdi32::CreateCompatibleDC([IntPtr]::Zero)
$Gdi32::SetLayout($DC, $LAYOUT_RTL) | Out-Null $Gdi32::SetLayout($DC, $LAYOUT_RTL) | Out-Null
$Gdi32::ScaleWindowExtEx($DC, [Int32]::MinValue, -1, 1, 1, [IntPtr]::Zero) | Out-Null $Gdi32::ScaleWindowExtEx($DC, [Int32]::MinValue, -1, 1, 1, [IntPtr]::Zero) | Out-Null
} }
}