Skip to content

Instantly share code, notes, and snippets.

View joshooaj's full-sized avatar

Josh Hendricks joshooaj

View GitHub Profile
@joshooaj
joshooaj / New-RandomPass.ps1
Last active December 10, 2024 23:31 — forked from steviecoaster/New-RandomPass.ps1
Cross platform password generator
function New-RandomPass {
<#
.Synopsis
Generates and returns a suitably secure password
.EXAMPLE
New-RandomPass
Returns a random password as a SecureString object
.EXAMPLE
@joshooaj
joshooaj / New-QueryString.ps1
Last active November 25, 2024 22:52 — forked from steviecoaster/New-QueryString.ps1
Creates a querystring to use with an API call
function New-QueryString {
<#
.SYNOPSIS
Turn a hashtable into a URI querystring
.DESCRIPTION
Turn a hashtable into a URI querystring
.PARAMETER QueryParameter
The hashtable to transform
function binaryout {
<#
.SYNOPSIS
Workaround for PowerShell processing the output of all external programs as strings
.DESCRIPTION
PowerShell treats any output from an external program as string which should be
split whenever it sees LF or CR LF. As a workround this calls the program with
Start-Process and redirects standard output to a file - on completion the file
is read and sent as a bytestream to the next process.