Skip to content

Instantly share code, notes, and snippets.

View mwjcomputing's full-sized avatar

Matthew Johnson mwjcomputing

View GitHub Profile
@mwjcomputing
mwjcomputing / Invoke-RestMethod.ps1
Last active December 12, 2015 01:08
Adds a force switch to Invoke-RestMethod
function Invoke-RestMethod {
[CmdletBinding(HelpUri='http://go.microsoft.com/fwlink/?LinkID=217034')]
param(
[Microsoft.PowerShell.Commands.WebRequestMethod]
${Method},
[Parameter(Mandatory=$true, Position=0)]
[ValidateNotNullOrEmpty()]
[uri]
${Uri},
@mwjcomputing
mwjcomputing / Search-Chrome.ps1
Last active December 11, 2015 20:08
This is an update to jwgoerlich's Search-Chrome Function.
function Search-Chrome {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[string]$Search
)
begin {
Write-Verbose -Message "Starting $($MyInvocation.Mycommand)"
@mwjcomputing
mwjcomputing / Get-GitHubStatus.ps1
Created December 10, 2012 19:33
Get Github's Status
function Get-GitHubStatus {
$gitHub = Invoke-WebRequest -Uri 'https://status.github.com/api/status.json'
$gitHub | ConvertFrom-Json
}
@mwjcomputing
mwjcomputing / Send-Packet.ps1
Created November 15, 2012 14:34
Packet Fun
$Port = 80
$IPAddress = "10.0.1.95"
$Address = [System.Net.IPAddress]::Parse($IPAddress)
$EndPoint = New-Object System.Net.IPEndPoint $Address, $Port
$AddressFamily = [System.Net.Sockets.AddressFamily]::InterNetwork
$SocketType = [System.Net.Sockets.SocketType]::Dgram
$ProtocolType = [System.Net.Sockets.ProtocolType]::Udp
@mwjcomputing
mwjcomputing / New-Packet.ps1
Created November 14, 2012 15:39
PacketTestCode
Add-Type -Path "$env:userprofile\Documents\Development\Other Files\PacketDotNet-0.12.0\release\PacketDotNet.dll"
$sourcePort = "31623"
$destPort = "80"
$packet = New-Object PacketDotNet.TcpPacket($sourcePort,$destPort)
$sourceAddr = [System.Net.IPAddress]::Parse("10.0.0.1")
$destAddr = [System.Net.IPAddress]::Parse("10.0.1.95")
$ipPacket = New-Object PacketDotNet.IPv4Packet($sourceAddr, $destAddr)