Curated Examples
Capture desktop screenshots
Use DesktopManager to capture desktop screenshots into a script-local output folder.
This pattern is useful for troubleshooting display state or collecting visual evidence during automation.
It is adapted from Examples/GetDesktopScreenshot.ps1.
Example
Import-Module DesktopManager
$outputPath = Join-Path $PSScriptRoot 'Output'
New-Item -ItemType Directory -Path $outputPath -Force | Out-Null
Invoke-DesktopScreenshot -Path (Join-Path $outputPath 'DesktopScreenshot.png')
Invoke-DesktopScreenshot -Path (Join-Path $outputPath 'PrimaryMonitor.png') -Index 0
Invoke-DesktopScreenshot -Path (Join-Path $outputPath 'Region.png') -Left 100 -Top 100 -Width 800 -Height 600
What this demonstrates
- capturing full desktop output
- targeting a specific monitor by index
- capturing a defined screen region