{"id":3679,"date":"2014-02-12T11:46:13","date_gmt":"2014-02-12T16:46:13","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3679"},"modified":"2014-02-12T11:46:13","modified_gmt":"2014-02-12T16:46:13","slug":"get-powershell-parameter-aliases","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/","title":{"rendered":"Get PowerShell Parameter Aliases"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass-150x150.png\" alt=\"magnifying-glass\" width=\"150\" height=\"150\" class=\"alignleft size-thumbnail wp-image-3539\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass-150x150.png 150w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass.png 288w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a> During a recent PowerShell training class we naturally covered aliases. An alias is simply an alternate name, often something that is shorter to type, or maybe even more meaningful. There are aliases for commands, properties and parameters. Discovering aliases for commands is pretty easy with Get-Alias. Property aliases are discoverable using Get-Member. But, discovering parameter aliases is a bit more difficult. The information is there, but doesn't surface very well. It would be terrific if help showed parameter aliases but it rarely does. So here are some ways you might find parameter aliases.<\/p>\n<p>One way is to use Get-Help.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; get-help get-process -Parameter * | where {$_.aliases} | select name,aliases\r\n\r\nname                                              aliases\r\n----                                              -------\r\nComputerName                                      Cn\r\nFileVersionInfo                                   FV,FVI\r\nId                                                PID\r\nName                                              ProcessName<\/pre>\n<p>But you need to use Get-Help. If you use the Help function it won't work. In the command I filtered out parameters that didn't have aliases. You can also pipe Get-Command to Get-Help.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; get-command get-process | get-help -Parameter * | where {$_.aliases} | select name,aliases\r\n\r\nname                                              aliases\r\n----                                              -------\r\nComputerName                                      Cn\r\nFileVersionInfo                                   FV,FVI\r\nId                                                PID\r\nName                                              ProcessName<\/pre>\n<p>But for some reason, this doesn't always work.  There are aliases for Get-Service, but these same commands fail to show it.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; get-help get-service -Parameter * | where {$_.aliases} | select name,aliases\r\nPS C:\\&gt; get-command get-service | get-help -Parameter * | where {$_.aliases} | select name,aliases<\/pre>\n<p>I know there are aliases because Get-Command shows me, although it takes a little work to extract this information.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; (get-command get-service).parameters.getenumerator() | foreach {$_.value} | Select Name,Alia\r\nses\r\n\r\nName                                              Aliases\r\n----                                              -------\r\nName                                              {ServiceName}\r\nComputerName                                      {Cn}\r\nDependentServices                                 {DS}\r\nRequiredServices                                  {SDO, ServicesDependedOn}\r\nDisplayName                                       {}\r\nInclude                                           {}\r\nExclude                                           {}\r\nInputObject                                       {}\r\nErrorAction                                       {ea}\r\nWarningAction                                     {wa}\r\nVerbose                                           {vb}\r\nDebug                                             {db}\r\nErrorVariable                                     {ev}\r\nWarningVariable                                   {wv}\r\nOutVariable                                       {ov}\r\nOutBuffer                                         {ob}\r\nPipelineVariable                                  {pv}<\/pre>\n<p>Plus I can verify at the prompt:<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; get-service wuauserv -cn $hvr2 -sdo\r\n\r\nStatus   Name               DisplayName\r\n------   ----               -----------\r\nRunning  rpcss              Remote Procedure Call (RPC)<\/pre>\n<p>Since it appears I can always get the information from Get-Command, I wrote a function called Get-ParameterAlias.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\nFunction Get-ParameterAlias {\r\n\r\n&lt;#\r\n.SYNOPSIS\r\nList command parameter aliases\r\n.DESCRIPTION\r\nThis command will display all of the parameter aliases for a given command or \r\nalias. It isn't always easy to discover parameter aliases. Many are not \r\ndocumented on cmdlet help. But they can be discovered by digging into the\r\noutput from Get-Command. \r\n\r\nSpecify a command or alias or pipe results from Get-Command to this command.\r\n\r\nBy default, common parameters such as ErrorAction, or omitted unless you \r\nuse -IncludeCommon\r\n.EXAMPLE\r\nPS C:\\&gt; get-parameteralias invoke-command\r\n\r\nCommand                          Name                                       Aliases \r\n-------                          ----                                       ------- \r\nInvoke-Command                   ComputerName                               {Cn}    \r\nInvoke-Command                   ConnectionUri                              {URI, CU}\r\nInvoke-Command                   InDisconnectedSession                      {Disconnected}\r\nInvoke-Command                   HideComputerName                           {HCN}         \r\nInvoke-Command                   ScriptBlock                                {Command}\r\nInvoke-Command                   FilePath                                   {PSPath} \r\nInvoke-Command                   ArgumentList                               {Args} \r\n\r\n.EXAMPLE\r\nPS C:\\&gt;  get-command dir | Get-ParameterAlias\r\n\r\nCommand                         Name                                       Aliases                                   \r\n-------                         ----                                       -------                                   \r\nInvoke-Command                  ComputerName                               {Cn}\r\nInvoke-Command                  ConnectionUri                              {URI, CU}\r\nInvoke-Command                  InDisconnectedSession                      {Disconnected}\r\nInvoke-Command                  HideComputerName                           {HCN} \r\nInvoke-Command                  ScriptBlock                                {Command}\r\nInvoke-Command                  FilePath                                   {PSPath}\r\nInvoke-Command                  ArgumentList                               {Args} \r\n\r\n\r\n.NOTES\r\nLast Updated: 2\/11\/2014 \r\nVersion     : 0.9\r\n\r\nLearn more:\r\n PowerShell in Depth: An Administrator's Guide (http:\/\/www.manning.com\/jones2\/)\r\n PowerShell Deep Dives (http:\/\/manning.com\/hicks\/)\r\n Learn PowerShell 3 in a Month of Lunches (http:\/\/manning.com\/jones3\/)\r\n Learn PowerShell Toolmaking in a Month of Lunches (http:\/\/manning.com\/jones4\/)\r\n\r\n\r\n  ****************************************************************\r\n  * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED *\r\n  * THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK.  IF   *\r\n  * YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, *\r\n  * DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.             *\r\n  ****************************************************************\r\n.LINK\r\nGet-Command\r\n.LINK\r\nhttp:\/\/jdhitsolutions.com\/blog\/2014\/02\/get-powershell-parameter-aliases\r\n.INPUTS\r\n[String] or [System.Management.Automation.CmdletInfo] or [System.Management.Automation.AliasInfo]\r\n.OUTPUTS\r\n[System.Management.Automation.ParameterMetadata]\r\n#&gt;\r\n\r\n[cmdletbinding()]\r\nParam(\r\n[Parameter(Position=0,Mandatory=$True,\r\nHelpMessage=\"Enter a command or cmdlet name\",\r\nValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]\r\n[ValidateNotNullorEmpty()]\r\n[Alias(\"command\")]\r\n[object]$Name,\r\n[Switch]$IncludeCommon\r\n)\r\n\r\nBegin {\r\n    Write-Verbose \"Starting $($MyInvocation.mycommand)\"\r\n    if ($IncludeCommon) {\r\n        $common=$Null\r\n    } \r\n    else {\r\n    #define common parameter names. PipelineVariable was added in v4.\r\n    $common= \"Verbose\",\"Debug\",\"ErrorAction\",\"WarningAction\",\r\n    \"ErrorVariable\",\"WarningVariable\",\"OutVariable\",\"OutBuffer\",\r\n    \"Whatif\",\"Confirm\",\"PipelineVariable\"    \r\n\r\n    }\r\n} #begin\r\n\r\nProcess {\r\n\r\nTry {\r\n\r\n    #test if piped in object is already a command info object\r\n    if ($Name -is [System.Management.Automation.CmdletInfo]) {\r\n      Write-Verbose \"Processing a command\"\r\n      $parameters = $name.Parameters\r\n      $commandname= $name.Name\r\n    }\r\n    elseif ($Name -is [System.Management.Automation.AliasInfo]) {\r\n      Write-Verbose \"Processing an alias\"\r\n      $parameters = $name.Parameters\r\n      $commandname= $name.ResolvedCommand\r\n    }\r\n    else {\r\n        #must be a string so get the command\r\n        Write-Verbose \"Getting command information for $Name\"\r\n        $command = Get-Command $Name -ErrorAction \"Stop\"\r\n        $commandname= $command.Name\r\n        $parameters = $command.parameters\r\n    }\r\n} #try\r\n\r\nCatch\r\n{\r\n    Write-Warning \"Failed to find command $Name. $($_.Exception.message)\"\r\n   \r\n    #bail out\r\n    Return\r\n}\r\n\r\nWrite-Verbose \"Analyzing $CommandName\"\r\nif ($parameters) {\r\n    $parameters.GetEnumerator() | where {$_.key -notin $common} |\r\n    foreach {\r\n      #get parameters with aliases\r\n      $_.value | where {$_.Aliases} | \r\n      Select @{Name=\"Command\";Expression={$CommandName}},Name,Aliases\r\n    }\r\n } #if parameters found  \r\n} #process\r\n\r\nEnd {\r\n    Write-Verbose \"Ending $($MyInvocation.mycommand)\"\r\n} #end\r\n} #end function\r\n\r\n#set an optional alias\r\nSet-Alias -Name gpa -value Get-ParameterAlias<\/pre>\n<p>The function can take a command name or you can pipe something from Get-Command.<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; Get-ParameterAlias get-wmiobject\r\n\r\nCommand                           Name                             Aliases\r\n-------                           ----                             -------\r\nGet-WmiObject                     Class                            {ClassName}\r\nGet-WmiObject                     ComputerName                     {Cn}\r\nGet-WmiObject                     Namespace                        {NS}\r\n\r\n\r\nPS C:\\&gt; get-command get-service | get-parameteralias\r\n\r\nCommand                           Name                             Aliases\r\n-------                           ----                             -------\r\nGet-Service                       Name                             {ServiceName}\r\nGet-Service                       ComputerName                     {Cn}\r\nGet-Service                       DependentServices                {DS}\r\nGet-Service                       RequiredServices                 {SDO, ServicesDependedOn}<\/pre>\n<p>Because parameter information from Get-Command includes common parameters such as -ErrorAction, I've skipped those by default, unless you use the -IncludeCommon parameter.<\/p>\n<p>Now it is easy to discover parameter aliases for say a module.<\/p>\n<pre class=\"lang:ps decode:true \" >get-command -module hyper-v | get-parameteralias | out-gridview -title \"Hyper-V Aliases\"<\/pre>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/get-parameteralias.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/get-parameteralias-300x237.png\" alt=\"get-parameteralias\" width=\"300\" height=\"237\" class=\"aligncenter size-medium wp-image-3681\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/get-parameteralias-300x237.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/get-parameteralias.png 701w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Knowing parameter aliases can make you more efficient in the console. But remember, when committing PowerShell to a script use the full parameter name as some of these aliases can be a bit cryptic.<\/p>\n<p>As always, I hope you'll let me know what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During a recent PowerShell training class we naturally covered aliases. An alias is simply an alternate name, often something that is shorter to type, or maybe even more meaningful. There are aliases for commands, properties and parameters. Discovering aliases for commands is pretty easy with Get-Alias. Property aliases are discoverable using Get-Member. But, discovering parameter&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"new from the blog: Get PowerShell Parameter Aliases http:\/\/wp.me\/p1nF6U-Xl","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[160,78,367,307,534],"class_list":["post-3679","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-alias","tag-get-command","tag-get-help","tag-parameter","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get PowerShell Parameter Aliases &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get PowerShell Parameter Aliases &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"During a recent PowerShell training class we naturally covered aliases. An alias is simply an alternate name, often something that is shorter to type, or maybe even more meaningful. There are aliases for commands, properties and parameters. Discovering aliases for commands is pretty easy with Get-Alias. Property aliases are discoverable using Get-Member. But, discovering parameter...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-02-12T16:46:13+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass-150x150.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get PowerShell Parameter Aliases\",\"datePublished\":\"2014-02-12T16:46:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/\"},\"wordCount\":299,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/magnifying-glass-150x150.png\",\"keywords\":[\"Alias\",\"Get-Command\",\"Get-Help\",\"parameter\",\"PowerShell\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/\",\"name\":\"Get PowerShell Parameter Aliases &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/magnifying-glass-150x150.png\",\"datePublished\":\"2014-02-12T16:46:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/magnifying-glass.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/magnifying-glass.png\",\"width\":288,\"height\":288},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3679\\\/get-powershell-parameter-aliases\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get PowerShell Parameter Aliases\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get PowerShell Parameter Aliases &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/","og_locale":"en_US","og_type":"article","og_title":"Get PowerShell Parameter Aliases &#8226; The Lonely Administrator","og_description":"During a recent PowerShell training class we naturally covered aliases. An alias is simply an alternate name, often something that is shorter to type, or maybe even more meaningful. There are aliases for commands, properties and parameters. Discovering aliases for commands is pretty easy with Get-Alias. Property aliases are discoverable using Get-Member. But, discovering parameter...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-02-12T16:46:13+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass-150x150.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get PowerShell Parameter Aliases","datePublished":"2014-02-12T16:46:13+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/"},"wordCount":299,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass-150x150.png","keywords":["Alias","Get-Command","Get-Help","parameter","PowerShell"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/","name":"Get PowerShell Parameter Aliases &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass-150x150.png","datePublished":"2014-02-12T16:46:13+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass.png","width":288,"height":288},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Get PowerShell Parameter Aliases"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1330,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1330\/powershell-ise-convert-all-aliases\/","url_meta":{"origin":3679,"position":0},"title":"PowerShell ISE Convert All Aliases","author":"Jeffery Hicks","date":"April 8, 2011","format":false,"excerpt":"Yesterday I posted an article on how to convert a selected word to an alias or cmdlet. While I think there is still some value in this piecemeal approach. sometimes you want to make wholesale changes, such as when troubleshooting a script that someone else wrote that is full of\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8724,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8724\/discovering-aliases-with-the-powershell-ast\/","url_meta":{"origin":3679,"position":1},"title":"Discovering Aliases with the PowerShell AST","author":"Jeffery Hicks","date":"December 15, 2021","format":false,"excerpt":"I've been working on a new PowerShell module that incorporates code from a few of my recent posts on converting PowerShell scripts and functions to files. I even whipped up a script, think of it as a meta-script, to create the module using the commands that I am adding to\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/find-alias-string.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/find-alias-string.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/find-alias-string.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/12\/find-alias-string.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":714,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/714\/get-parameter\/","url_meta":{"origin":3679,"position":2},"title":"Get Parameter","author":"Jeffery Hicks","date":"July 21, 2010","format":false,"excerpt":"As I continue to work on the 2nd edition of Managing Active Directory with Windows PowerShell: TFM, I find situations where I need a tool to get information out of Windows PowerShell. For example, the cmdlets in the Microsoft Active Directory module have a lot of parameters and I wanted\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7604,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/","url_meta":{"origin":3679,"position":3},"title":"Discovering Provider Specific Commands","author":"Jeffery Hicks","date":"July 22, 2020","format":false,"excerpt":"I've been diving into PowerShell help lately while preparing my next Pluralsight course. One of the sad things I have discovered is the loss of provider-aware help. As you may know, some commands have parameters that only exist when using a specific PSDrive.\u00a0 For example, the -File parameter for Get-ChildItem\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1324,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1324\/powershell-ise-alias-to-command\/","url_meta":{"origin":3679,"position":4},"title":"PowerShell ISE Alias to Command","author":"Jeffery Hicks","date":"April 7, 2011","format":false,"excerpt":"Earlier this week I posted a function that you could incorporate into the PowerShell ISE to convert selected text to upper or lower case. I was challenged to take this a step further and come up with a way to convert aliases to commands. Which is exactly what I did.\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1340,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/","url_meta":{"origin":3679,"position":5},"title":"Convert Aliases with the Tokenizer","author":"Jeffery Hicks","date":"April 12, 2011","format":false,"excerpt":"Last week I posted a function you can use in the Windows PowerShell ISE to convert aliases to command definitions. My script relied on regular expressions to seek out and replace aliases. A number of people asked me why I didn't use the PowerShell tokenizer. My answer was that because\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=3679"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3679\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}