Skip to content

Latest commit

 

History

History
165 lines (117 loc) · 11.7 KB

File metadata and controls

165 lines (117 loc) · 11.7 KB

Useful General-Purpose Scripts

Pester tests results ![Pester tests coverage](https://img.shields.io/badge/Pester_coverage-3196_‱-orange red) GitHub license badge GitHub stars badge GitHub watchers badge GitHub forks badge GitHub issues badge GitHub commits badge GitHub last commit badge Mastodon: @dataelemental@mastodon.social Mastodon: @brianary@mastodon.spotek.io

Note

Many scripts have been moved into modules to improve their usability! See ModernConveniences and the scripts-to-modules.json roadmap. Use Convert-ExternalScriptToModule.ps1 to convert your scripts!

This repo contains a collection of generally useful scripts (mostly Windows PowerShell).

See PS5 for legacy scripts, syscfg for single-use system config scripts.

PowerShell Scripts

Command

Configuration

Console

Credential

Data formats

  • Test-Windows1252.ps1: Determines whether a file contains Windows-1252 bytes that are invalid UTF-8 bytes.

Database

Date and time

DotNet

EnvironmentVariables

Files

Packages and libraries

PowerShell

Scheduled Tasks

Scripts

  • 🆙 New-PesterTests.ps1: Creates a new Pester testing script from a script's examples and parameter sets.
  • 🆙 New-Script.ps1: Creates a simple boilerplate script.
  • Optimize-Help.ps1: Cleans up comment-based help blocks by fully unindenting and capitalizing dot keywords.
  • 🆙 Rename-Script.ps1: Renames all instances of a script, and updates any usage of it.

Search and replace

  • Find-Lines.ps1: Searches a specific subset of files for lines matching a pattern.

System and updates

Unicode

Windows Terminal

Other

F# Scripts

Office VBA Scripts

  • OutlookExpireTag.vba: Too many emails remain beyond their period of relevance: daily personnel schedule changes, found item notices, office food notices, server reboot notices, weather/traffic warnings, &c. This Outlook script will allow specifying an expiration date as a hashtag in the subject of outgoing emails, since Outlook does such a good job of hiding the UI for that field. -BL
  • OutlookPasteFormattedIndented.vba: Outlook will strip single-space indents when displaying emails. If you've got, for example, syntax highlighted source code that employs any indentation of only one space, you'll want to add two spaces to the each line (adding one will not appear for text that isn't indented). This Outlook script will paste formatted text, and indent it. Requires Tools -> References -> Microsoft Word 14.0 Object Library (later versions may also work)
  • OutlookPasteTsvTable.vba: This Outlook VBA Sub can be connected to a toolbar button for pasting TSV data as an attractive, formatted table. -BL Requires Tools -> References -> Microsoft Word 14.0 Object Library (later versions may also work)