Skip to content

Instantly share code, notes, and snippets.

@Halkcyon
Created November 26, 2018 16:22
Show Gist options
  • Save Halkcyon/1f8454f05c1c8514484545762652de38 to your computer and use it in GitHub Desktop.
Save Halkcyon/1f8454f05c1c8514484545762652de38 to your computer and use it in GitHub Desktop.
Proxy function/alias for Select-Object
$c = [System.Management.Automation.CommandMetadata]::new((Get-Command -Name Select-Object))
$c.Parameters.Remove('Property')
$p = [System.Management.Automation.ProxyCommand]::Create($c) -split "`n"
# -ExpandProperty
$p[12] = $p[12] -replace '(?<=Parameter\()', 'Position=0, '
${function:global:$} = [scriptblock]::Create($p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment