Skip to content

Instantly share code, notes, and snippets.

# 1. Делаем скриншот
Add-Type -AssemblyName System.Windows.Forms
$screen = [System.Windows.Forms.Screen]::PrimaryScreen
$top, $left = $screen.Bounds.Top, $screen.Bounds.Left
$width, $height = $screen.Bounds.Width, $screen.Bounds.Height
$bitmap = New-Object System.Drawing.Bitmap($width, $height)
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
$graphics.CopyFromScreen($left, $top, 0, 0, $bitmap.Size)
# Сохраняем во временную папку