Hello r/PowerShell! I hope you had a great weekend!
Last week I created a new PowerShell Module called CaptureIT. This module will allow you to generate GIFs of the actively selected window or your entire desktop screen.
This solution is created using native .NET assemblies (no third-party libraries) and written in PowerShell!!
You can find the source on GitHub: CaptureIT
You can also download this Module from the PowerShell Gallery:
Install-Module -Name CaptureIT
This Module is not 100% at this point, but I found it to be stable. If you try it out and have any suggestions or encounter issues, please add an issue to GitHub. I plan on continually updating this one - because who doesn't love gifs!
Using CaptureIT
To use this module, you will first need to download/clone the repository and import the module:
Import-Module .\CaptureIT.psm1
Once you have imported the module you can use the main wrapper funtion Start-Capture to capture you entire desktop screen. Additionally, you will need to specify the FilePath of your generated GIF.
Start-Capture -Screen -FilePath "c:\users\msadministrator\Desktop\mynewgif.gif"
If you would like to capture the active window, you will need to specify the switch for ActiveWindow:
Start-Capture -ActiveWindow -FilePath "c:\users\msadministrator\Desktop\mynewgif.gif"
EDIT: Thank you all for the feedback! I have just pushed changes that, I believe, handle how to stop the capturing process a bit better. You now will be presented with feedback on a key press. Similar to this:
Press the 'x' key to stop capturing.
You pressed the A key.
Press the 'x' key to stop capturing.
You pressed the H key.
Press the 'x' key to stop capturing.
You pressed the D key.
In order to STOP capturing you need to press x:
Press the 'x' key to stop capturing.
You pressed the X key.
Thanks again for all the support!