A collection of PowerShell scripts for managing certificates and taking screenshots on Windows.
Adds a single certificate to the Trusted Root Certification Authorities store for the current user.
Usage:
.\addcerts.ps1 -CertPath "C:\path\to\certificate.cer"Parameters:
-CertPath: The full path to the certificate file (.cer) to be added
Example:
.\addcerts.ps1 -CertPath "C:\certificates\mycert.cer"Adds all .crt certificate files from a specified directory to the Trusted Root Certification Authorities store for the current user.
Usage:
.\addcertsindirectory.ps1 -CertDir "C:\path\to\certificates"Parameters:
-CertDir: The full path to the directory containing the .crt certificate files
Example:
.\addcertsindirectory.ps1 -CertDir "C:\certificates"Notes:
- Only
.crtfiles in the specified directory will be processed - The script will continue processing other certificates if one fails
- Each certificate addition is logged with success or failure status
Takes a screenshot of the primary screen and saves it to the user's Pictures folder with a date-stamped filename.
Usage:
.\screenshot.ps1Features:
- Prompts for a base filename
- Automatically appends the current date (YYYYMMDD format)
- Automatically increments a counter if a file with the same name already exists
- Saves screenshots as PNG files
Example Output:
- First screenshot:
my_screenshot-20250210.png - If file exists:
my_screenshot-20250210-001.png,my_screenshot-20250210-002.png, etc.
- Windows PowerShell 5.1 or PowerShell 7+
- Appropriate execution policy (may need to run
Set-ExecutionPolicy)
If you encounter execution policy errors, you may need to adjust PowerShell's execution policy:
Check current policy:
Get-ExecutionPolicySet policy for current user (if needed):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -ForceNote: The addcertsindirectory.ps1 script includes detailed notes about execution policy management in its header comments.
Jason Goodloe
This project is provided as-is for internal use.