Skip to content

Instantly share code, notes, and snippets.

@shaneis
Last active October 4, 2018 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaneis/cc8f035fd0d6d6b4cf00740b7a4cba90 to your computer and use it in GitHub Desktop.
Save shaneis/cc8f035fd0d6d6b4cf00740b7a4cba90 to your computer and use it in GitHub Desktop.
function Get-ParameterAlias {
[CmdletBinding()]
param (
[Parameter(Position = 0)]
[Alias('Function')]
[String[]]
$Command
)
begin {
}
process {
Write-Verbose -Message "[PROCESS] Checking parameter aliases for [$_]..."
foreach ($cmd in (Get-Command -Name $Command -CommandType Function).Name) {
$cmdObject = Get-Command -Name $cmd
$cmdObject.Parameters.Values |
ForEach-Object -Process {
[PSCustomObject]@{
Command = $cmd
Parameterr = $_.Name
Alias = $_ | Select-Object -ExpandProperty Aliases
}
}
}
}
end {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment