Last active
October 4, 2018 13:25
-
-
Save shaneis/cc8f035fd0d6d6b4cf00740b7a4cba90 to your computer and use it in GitHub Desktop.
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-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