Skip to content

Instantly share code, notes, and snippets.

@cbilson
Created February 8, 2012 18:31
Show Gist options
  • Save cbilson/1771972 to your computer and use it in GitHub Desktop.
Save cbilson/1771972 to your computer and use it in GitHub Desktop.
A function that creates aliases with arguments curried in
function global:New-CurryAlias($name, $value) {
$wrapperFunctionName = "Invoke-Curried-$name"
$wrapperFunctionPath = "function:global:$wrapperFunctionName"
Set-Item -Force -Path $wrapperFunctionPath `
-Value "Invoke-Expression -Command '$value $args'"
New-Alias -Force -Name $name -Value $wrapperFunctionName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment