Had a project where I was required to have a screenshot taken when results were found during a PowerShell search. I created a quick function called "Get-ScreenShot", by default the screenshots will save to the desktop folder. I have also coded the auto naming of the file. Additionally added a feature to allow you to select what screenshot resolution, by default the script will take 4k resolution screenshots.
Here is the script in action: