Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created December 5, 2017 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save IISResetMe/cba955fc01b84fff4396dada77e36102 to your computer and use it in GitHub Desktop.
Save IISResetMe/cba955fc01b84fff4396dada77e36102 to your computer and use it in GitHub Desktop.
CthulhuShell
function πŸ™ {
$name,$params = $args.Where({$_ -eq 'πŸ’©'},'Until')
$null,$body = $args.Where({$_ -eq 'πŸ’©'},'SkipUntil')
$params = @($params |? {$_})
$func = @"
param($(($params |% {"`${$_}"})-join','))
$(($params |% {$body = $body -replace "($([regex]::Escape($_)))",'(&$${$1})'}))
$body
"@
"function global:$name {$func}" |Invoke-Expression
}
πŸ™ 1️⃣ πŸ’© 1
πŸ™ 2️⃣ πŸ’© 2
πŸ™ βž• πŸ…°οΈ πŸ…±οΈ πŸ’© πŸ…°οΈ+πŸ…±οΈ
βž• 1️⃣ 2️⃣
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment