Skip to content

Instantly share code, notes, and snippets.

View MatthewSteeples's full-sized avatar

Matthew Steeples MatthewSteeples

View GitHub Profile
@MatthewSteeples
MatthewSteeples / Replace-FileString.ps1
Created October 30, 2014 11:26
Powershell script to find and replace file contents
# Replace-FileString.ps1
# Written by Bill Stewart ([email protected])
# Modified by Matthew Steeples ([email protected]) to enable using the
# -Recurse flag on Get-ChildItem and piping in
#
# Replaces strings in files using a regular expression. Supports
# multi-line searching and replacing.
#requires -version 2
@MatthewSteeples
MatthewSteeples / gist:d47f2ea58f63cdab1e24
Created February 13, 2015 20:55
Demonstration of Capability propagation
[RequiresCapability("SQL")]
public class TestBaseClass
{
[TestMethod]
public void RunTest1()
{
}
}
[RequiresCapability("ATS")]
@MatthewSteeples
MatthewSteeples / mousemove.ps1
Created February 26, 2015 19:09
Powershell Script to keep the mouse moving
Add-Type -AssemblyName System.Windows.Forms
while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X % 500) + 1
$y = ($pos.Y % 500) + 1
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 10
}
@MatthewSteeples
MatthewSteeples / bankholiday.ps1
Created June 2, 2021 10:25
Is today a UK Bank Holiday?
((Invoke-WebRequest https://www.gov.uk/bank-holidays/england-and-wales.json).Content | ConvertFrom-Json).events.Where({ $_.date -eq [DateTime]::Today.ToString("yyyy-MM-dd")}).Count -gt 0