This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RegExExpandedValues { | |
<# wet with class as it keeps stuff together and I can put a bit of code in it. | |
I extend to other types might use inheritance at some point. shrug #> | |
$OriginalString | |
$ValueList | |
<# I can't be bothered to fill it out right now, feel free.#> | |
static [hashtable]$SlashCodes = @{ | |
[char]'d' = 0..9 | ForEach-Object { "$_" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IPSubnet { | |
[ipaddress]$InitialAddress | |
[ValidateRange(0,128)] | |
[int]$SubnetLength | |
# basic constructor | |
IPSubnet([ipaddress]$InitialAddress,[int]$SubnetLength){ | |
$this.InitialAddress = $InitialAddress | |
$this.SubnetLength = $SubnetLength |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertTo-DeflateBase64String{ | |
[cmdletbinding(DefaultParameterSetName="String")] | |
Param( | |
[Parameter(ParameterSetName="String",Mandatory=$true,ValueFromPipeline=$true,Position=1)][string]$String, | |
[Parameter(ParameterSetName="Byte",Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=2)] | |
[Byte[]]$Bytes | |
) | |
process{ | |
$ms = New-Object System.IO.MemoryStream | |
$cwr = New-Object System.IO.Compression.DeflateStream($ms,[System.IO.Compression.CompressionMode]::Compress) |