{"id":1340,"date":"2011-04-12T09:22:44","date_gmt":"2011-04-12T13:22:44","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1340"},"modified":"2011-04-12T09:22:44","modified_gmt":"2011-04-12T13:22:44","slug":"convert-aliases-with-the-tokenizer","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/","title":{"rendered":"Convert Aliases with the Tokenizer"},"content":{"rendered":"<p>Last week I posted a function you can use in the Windows PowerShell ISE to <a href=\"http:\/\/jdhitsolutions.com\/blog\/2011\/04\/powershell-ise-alias-to-command\/\" target='_blank'>convert aliases to command definitions<\/a>. 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 I'm not a developer and don't think that way. But after working a bit with it I can see the value so I have another function you can use in the ISE to convert aliases to commands.<!--more--><\/p>\n<p>This function, ConvertFrom-Alias, will parse a complete script in the ISE and replace all aliases with their command line definitions.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction ConvertFrom-Alias {<\/p>\n<p>Param (<br \/>\n    [Parameter(Position=0)]<br \/>\n    [ValidateNotNullorEmpty()]<br \/>\n    $Text=$psISE.CurrentFile.Editor.text<br \/>\n)<\/p>\n<p>#make sure we are using the ISE<br \/>\nif ($host.name -match \"ISE\")<br \/>\n{<\/p>\n<p>#Turn the script into syntax tokens<br \/>\nWrite-Verbose \"Tokenizing\"<\/p>\n<p>#verify there are no syntax errors first by Tokenizing the script<br \/>\n$out=$null<br \/>\n$tokens = [System.Management.Automation.PSparser]::Tokenize($text, [ref]$out)<\/p>\n<p>#if there are errors they will be directed to $out<br \/>\nif ($out)<br \/>\n{<br \/>\n    #enumerate each parsing error in $out<br \/>\n    foreach ($problem in $out) {<br \/>\n        Write-Warning $problem.message<br \/>\n        Write-Warning \"Line: $($problem.Token.Startline) at character: $($problem.token.StartColumn)\"<br \/>\n    }<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n    #if no errors then proceed to convert<br \/>\n    $tokens | Where-Object { $_.Type -eq 'Command'} |<br \/>\n    Sort-Object StartLine, StartColumn -Descending |<br \/>\n      ForEach-Object {<br \/>\n          #handle the ? by escaping it<br \/>\n          if($_.content -eq '?')<br \/>\n          {<br \/>\n            Write-Verbose \"Found a ?\"<br \/>\n            $result = Get-Command -name '`?' -CommandType Alias<br \/>\n          }<br \/>\n          else<br \/>\n          {<br \/>\n            $result = Get-Command -name $_.Content -CommandType Alias -ErrorAction SilentlyContinue<br \/>\n          }<\/p>\n<p>          #check and see if Get-Command returned anything<br \/>\n          if($result)<br \/>\n          {<br \/>\n            #find each command and insert the corresponding command definition<br \/>\n            Write-Verbose \"Replacing $($result.name) with $($result.definition)\"<br \/>\n            $psISE.CurrentFile.Editor.Select($_.StartLine,$_.StartColumn,$_.EndLine,$_.EndColumn)<br \/>\n            $psISE.CurrentFile.Editor.InsertText($result.Definition)<br \/>\n          }<br \/>\n      } #foreach<br \/>\n } #else $tokens exists and there were no parsing errors<br \/>\n} #if ISE<br \/>\nelse<br \/>\n{<br \/>\n    Write-Warning \"You must be using the PowerShell ISE\"<br \/>\n}<\/p>\n<p>Write-Verbose \"Finished\"<\/p>\n<p>} #end Function<br \/>\n[\/cc]<\/p>\n<p>There is one primary difference between this and my regular expression version. This function processes the entire file and the regular expression version allows you to process selected text, so you may have a need for both. The other difference is that when using the tokenizer your script can't have any parsing errors. The function tokenizes the script and if there are errors writes results to the warning pipeline.<\/p>\n<p>[cc lang=\"Powershell\"]<br \/>\n#verify there are no syntax errors first by Tokenizing the script<br \/>\n$out=$null<br \/>\n$tokens = [System.Management.Automation.PSparser]::Tokenize($text, [ref]$out)<\/p>\n<p>#if there are errors they will be directed to $out<br \/>\nif ($out)<br \/>\n{<br \/>\n    #enumerate each parsing error in $out<br \/>\n    foreach ($problem in $out) {<br \/>\n        Write-Warning $problem.message<br \/>\n        Write-Warning \"Line: $($problem.Token.Startline) at character: $($problem.token.StartColumn)\"<br \/>\n    }<br \/>\n}<br \/>\n[\/cc] <\/p>\n<p>Tokenizing, by the way, is PowerShell's way of identifying the command elements so it can construct a pipelined expression. At least that's enough of a definition for our purposes. Assuming no errors, the tokens are processed with ForEach-Object.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$tokens | Where-Object { $_.Type -eq 'Command'} |<br \/>\n    Sort-Object StartLine, StartColumn -Descending |<br \/>\n      ForEach-Object {<br \/>\n[\/cc]<\/p>\n<p>The function looks for aliases in token content.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n $result = Get-Command -name $_.Content -CommandType Alias -ErrorAction SilentlyContinue<br \/>\n [\/cc]<\/p>\n<p>If if finds one, the corresponding text is replaced in the file.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n#check and see if Get-Command returned anything<br \/>\n          if($result)<br \/>\n          {<br \/>\n            #find each command and insert the corresponding command definition<br \/>\n            Write-Verbose \"Replacing $($result.name) with $($result.definition)\"<br \/>\n            $psISE.CurrentFile.Editor.Select($_.StartLine,$_.StartColumn,$_.EndLine,$_.EndColumn)<br \/>\n            $psISE.CurrentFile.Editor.InsertText($result.Definition)<br \/>\n          }<br \/>\n[\/cc]<\/p>\n<p>The end result is that the function finds the alias from the token and replaces it with the command. Very slick and pretty quick.  You can add this script to your profile and menu my other ISE tools. Just remember that that processes the entire script and it must be free of syntax errors.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/ConvertFrom-Alias.txt' target='_blank'>ConvertFrom-Alias<\/a> and let me know what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t use the PowerShell tokenizer. My answer was that because I&#8217;m not a developer and&#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":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[231,8],"tags":[160,232,534,275],"class_list":["post-1340","post","type-post","status-publish","format-standard","hentry","category-powershell-ise","category-scripting","tag-alias","tag-ise","tag-powershell","tag-tokenizer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Convert Aliases with the Tokenizer &#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\/scripting\/1340\/convert-aliases-with-the-tokenizer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Convert Aliases with the Tokenizer &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"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&#039;t use the PowerShell tokenizer. My answer was that because I&#039;m not a developer and...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-04-12T13:22:44+00:00\" \/>\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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Convert Aliases with the Tokenizer\",\"datePublished\":\"2011-04-12T13:22:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/\"},\"wordCount\":637,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Alias\",\"ISE\",\"PowerShell\",\"Tokenizer\"],\"articleSection\":[\"PowerShell ISE\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/\",\"name\":\"Convert Aliases with the Tokenizer &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-04-12T13:22:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1340\\\/convert-aliases-with-the-tokenizer\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell ISE\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell-ise\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert Aliases with the Tokenizer\"}]},{\"@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":"Convert Aliases with the Tokenizer &#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\/scripting\/1340\/convert-aliases-with-the-tokenizer\/","og_locale":"en_US","og_type":"article","og_title":"Convert Aliases with the Tokenizer &#8226; The Lonely Administrator","og_description":"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 I'm not a developer and...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-04-12T13:22:44+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Convert Aliases with the Tokenizer","datePublished":"2011-04-12T13:22:44+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/"},"wordCount":637,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Alias","ISE","PowerShell","Tokenizer"],"articleSection":["PowerShell ISE","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/","name":"Convert Aliases with the Tokenizer &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-04-12T13:22:44+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1340\/convert-aliases-with-the-tokenizer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell ISE","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},{"@type":"ListItem","position":2,"name":"Convert Aliases with the Tokenizer"}]},{"@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":1340,"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":1324,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1324\/powershell-ise-alias-to-command\/","url_meta":{"origin":1340,"position":1},"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":8724,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8724\/discovering-aliases-with-the-powershell-ast\/","url_meta":{"origin":1340,"position":2},"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":3679,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3679\/get-powershell-parameter-aliases\/","url_meta":{"origin":1340,"position":3},"title":"Get PowerShell Parameter Aliases","author":"Jeffery Hicks","date":"February 12, 2014","format":false,"excerpt":"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\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"magnifying-glass","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/magnifying-glass-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4398,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4398\/friday-fun-i-can-run-that-command-in-3-letters\/","url_meta":{"origin":1340,"position":4},"title":"Friday Fun: I Can Run that Command in 3 Letters","author":"Jeffery Hicks","date":"May 8, 2015","format":false,"excerpt":"If you have been using PowerShell for any length of time, I'm sure you are familiar with aliases. An alias is an alternative name to a PowerShell cmdlet. They are intended to serve as transition aids (like dir and ls) and as a means to keep interactive typing to a\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"Large Blog Image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/faveicon-551a9375v1_site_icon-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4420,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/4420\/friday-fun-a-better-psedit\/","url_meta":{"origin":1340,"position":5},"title":"Friday Fun: A Better PSEdit","author":"Jeffery Hicks","date":"May 29, 2015","format":false,"excerpt":"In the PowerShell ISE, there is a built-in function called PSEdit. You can use this function to easily load a file in to the ISE directly from the ISE command prompt. Psedit c:\\scripts\\myscript.ps1 You can also load multiple files, but not as easily as you might like. I find myself\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1340","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=1340"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1340\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}