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
# Published for http://powertoe.wordpress.com | |
# https://powertoe.wordpress.com/2017/10/23/h2o-machine-learning-with-powershell/ | |
function ConvertTo-FormData { | |
param( | |
[Parameter(ValueFromPipeline=$true)] [PSObject] $InputObject | |
) | |
Begin { | |
$output = "" | |
} |
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 Get-HistoryGrep { | |
param( | |
[Parameter(Mandatory=$false, Position=0)] | |
[string]$Regex | |
) | |
get-history |?{$_.commandline -match $regex} | |
} | |
function Invoke-History { | |
param( |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Bootstrap 101 Template</title> | |
<p></p><a href="http://getbootstrap.com/getting-started/#examples">Examples</a></p> | |
<!-- Bootstrap --> |
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
var HTML_COLORS = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue", "BlueViolet", | |
"Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan", "DarkBlue","DarkCyan", | |
"DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed", | |
"DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue", | |
"DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray", | |
"Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen", | |
"LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink", | |
"LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGre |
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 Write-Trace { | |
param( | |
[Parameter(Mandatory=$true, Position=0, ValueFromRemainingArguments=$true)] | |
[string]$message, | |
[Parameter(Mandatory=$false)] | |
[string]$category="PS Script" | |
) | |
[System.Diagnostics.Debug]::WriteLine($message, $category) | |
} |
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
# http://powertoe.wordpress.com/2012/11/02/powerbits-9-set-the-current-directory-to-the-script-directory-or-the-current-directory-if-run-in-a-session/ | |
$currdir = '' | |
if ($MyInvocation.MyCommand.Path) { | |
$currdir = Split-Path $MyInvocation.MyCommand.Path | |
} else { | |
$currdir = $pwd -replace '^\S+::','' | |
} |
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
# http://powertoe.wordpress.com/2013/09/26/powerbits-10-history-grep-or-hgrep-in-powershell/ | |
function hgrep { | |
param( | |
[Parameter(Mandatory=$false, Position=0)] | |
[string]$Regex, | |
[Parameter(Mandatory=$false)] | |
[switch]$Full | |
) | |
$commands = get-history |?{$_.commandline -match $regex} |
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 Get-Periscope { | |
param( | |
[Parameter(Mandatory=$true, Position=0)] | |
[string] $Id, | |
[Parameter(Mandatory=$true)] | |
[ValidateScript({Test-Path $_})] | |
[string] $Path | |
) | |
if (!(test-path $Path)) { |
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
-----BEGIN RSA PRIVATE KEY----- | |
MIIEpQIBAAKCAQEA7oei2KnmNsq4pZVtcwtDN0zIrEmv5TgMxdLQtdIszqO/UJbp | |
Lbf4LG+DtT7eVmzmN3rSWV9Q7P7UdAds0j03c9sAwjprMuv5F1MzyC1rNQct5M5m | |
X0X0Scylan9HVccjTXt6Yr+IPni8PNOs0rwhqRB0TEtJuP2IYuzeg5Z2LWxnAVjL | |
5uNd9HMpuDwVHDMibpeMOomr2ePqdUPAK+ZRQbUYVvnR6fkzSKehcTvnKG6P1qhO | |
ifx6dsmls9HqrRpfBXmItAUaMO7VrQAjFybYgr8dHdVewLJqM2EmyN2buxEMIckp | |
afxb042mZbukJqZXEAZo2IYeee4NgSPV7fXhGwIDAQABAoIBAQDXg0s6MT+kb8Mn | |
MHyEPj/L3h9NswIuu1anAhO6w5viVAaOPNuPiDG9jD/W6WefdKMIq3sUbs9CYff4 | |
oaDLz62jitMDqh6jEpurXGxjx82eSs9HdMj/+cd/SlyGfVspgFRANHlecSkbMKD6 | |
4FG80WgkRY6eREPm1YN9xgBBqhc6b4GGZ2+hcVhkfYdnfmACy9+tIF6yHG5c4VPE |
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 = new-object psobject @{credential=$null} | |
function samplecred { | |
param( | |
[Parameter(Mandatory=$false)] | |
[ValidateScript({("String","PSCredential") -contains $_.gettype().name})] | |
[Object] $Credential | |
) | |
if ($Credential) { | |
switch ($Credential.gettype().name) { |
NewerOlder