Created
March 20, 2018 19:11
-
-
Save kvprasoon/dac5944cd87f72e6e35e85a8303f0f98 to your computer and use it in GitHub Desktop.
Script to save a Screenshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[String]$OutFilePath | |
) | |
Add-type -AssemblyName System.Drawing | |
$VirtualScreen = [System.Windows.Forms.SystemInformation]::VirtualScreen | |
$Bmp = New-Object System.Drawing.Bitmap $VirtualScreen.Width, $VirtualScreen.Height | |
$Graphic = [System.Drawing.Graphics]::FromImage($bmp) | |
$Graphic.CopyFromScreen($VirtualScreen.Left, $VirtualScreen.Top, 0, 0, $Bmp.Size) | |
$Bmp.Save($OutFilePath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment