From 2f28a290745c0ab216cbddf036175f8b44a6e611 Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Wed, 3 Jul 2013 22:15:05 -0400 Subject: Update Get-TimedScreenshot.ps1 Fix error handling and various style problems --- Exfiltration/Get-TimedScreenshot.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Exfiltration/Get-TimedScreenshot.ps1 b/Exfiltration/Get-TimedScreenshot.ps1 index e1c44d0..c14c723 100644 --- a/Exfiltration/Get-TimedScreenshot.ps1 +++ b/Exfiltration/Get-TimedScreenshot.ps1 @@ -50,7 +50,7 @@ https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-Timed ) #Define helper function that generates and saves screenshot - Function GenScreenshot { + Function Get-Screenshot { $ScreenBounds = [Windows.Forms.SystemInformation]::VirtualScreen $ScreenshotObject = New-Object Drawing.Bitmap $ScreenBounds.Width, $ScreenBounds.Height $DrawingGraphics = [Drawing.Graphics]::FromImage($ScreenshotObject) @@ -86,7 +86,7 @@ https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-Timed [String] $FilePath = (Join-Path $Path $FileName) #run screenshot function - GenScreenshot + Get-Screenshot Write-Verbose "Saved screenshot to $FilePath. Sleeping for $Interval seconds" @@ -94,8 +94,8 @@ https://github.com/mattifestation/PowerSploit/blob/master/Exfiltration/Get-Timed } #note that this will run once regardless if the specified time as passed - While ((Get-Date -Format HH:%m) -lt $EndTime) + While ((Get-Date -Format HH:mm) -lt $EndTime) } - Catch {Write-Warning "$Error[0].ToString() + $Error[0].InvocationInfo.PositionMessage"} -} \ No newline at end of file + Catch {Write-Error $Error[0].ToString() + $Error[0].InvocationInfo.PositionMessage} +} -- cgit v1.2.3