{"id":933,"date":"2010-09-16T09:09:45","date_gmt":"2010-09-16T13:09:45","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=933"},"modified":"2010-09-16T09:28:37","modified_gmt":"2010-09-16T13:28:37","slug":"powershell-ise-new-function","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/","title":{"rendered":"PowerShell ISE New Function"},"content":{"rendered":"<p>Yesterday I showed how to add a menu choice to the PowerShell ISE to insert the current date and time. Today I have something even better. At least it's something I've needed for awhile. I write a lot of advanced functions in PowerShell. I'm often cutting and pasting from previous scripts and generally not being very efficient. Shame on me. What I needed when using the ISE was a way to load a function template. Here's what I came up with.<!--more--><\/p>\n<p>First, I created a .ps1 file that defines a function called New-Function.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n#requires -version 2.0<\/p>\n<p>Function New-Function {<\/p>\n<p>$name=Read-Host \"What do you want to call the new function?\"<\/p>\n<p>$functionText=@\"<br \/>\n #requires -version 2.0<\/p>\n<p># -----------------------------------------------------------------------------<br \/>\n# Script: $name.ps1<br \/>\n# Author: $env:userdomain\\$env:username<br \/>\n# Date: $((get-date).ToShortDateString())<br \/>\n# Keywords:<br \/>\n# Comments:<br \/>\n#<br \/>\n# -----------------------------------------------------------------------------<\/p>\n<p>Function $name {<\/p>\n<p><#\n   .Synopsis\n    This does that \n    .Description\n    A longer explanation\n     .Parameter \n    The parameter\n   .Example\n    PS C:\\><br \/>\n    Example- accomplishes <\/p>\n<p>   .Notes<br \/>\n    NAME: $($name)<br \/>\n    VERSION: 1.0<br \/>\n    AUTHOR:  $env:userdomain\\$env:username<br \/>\n    LASTEDIT: $(Get-Date)<\/p>\n<p>   .Link<br \/>\n    about_Windows_PowerShell_2.0<\/p>\n<p>   .Inputs<br \/>\n    [String]<\/p>\n<p>   .Outputs<\/p>\n<p>#><\/p>\n<p>[cmdletBinding()]<\/p>\n<p>Param(<br \/>\n[Parameter(Position=0,Mandatory=`$False,<br \/>\nValueFromPipeline=`$True)]<br \/>\n[string[]]`$var<\/p>\n<p>)<\/p>\n<p>Begin {<br \/>\n    Write-Verbose -Message \"Starting  `$(`$myinvocation.mycommand)\"<\/p>\n<p> } #close Begin<\/p>\n<p>Process {<br \/>\n    Foreach (`$item in `$var) {<\/p>\n<p>    }#close Foreach $item<\/p>\n<p> } #close process<\/p>\n<p>End {<br \/>\n    Write-Verbose -Message \"Ending  `$(`$myinvocation.mycommand)\"<br \/>\n } #close End<\/p>\n<p>} #end Function<\/p>\n<p>\"@<\/p>\n<p>#load the function text into the current file in the ISE<br \/>\n$psise.CurrentFile.Editor.InsertText($FunctionText)<\/p>\n<p>} #end function<br \/>\n[\/cc]<br \/>\nThe purpose of this function is to define a here string for the actual template, and then a command to insert it into the current file in the ISE.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n$psise.CurrentFile.Editor.InsertText($FunctionText)<br \/>\n[\/cc]<br \/>\nThe New-Function function prompts you, using Read-Host, for the name of your new function and then inserts this value into the function text. I've also included some other variables that get expanded like the userdomain and username. For lines where I want the function to use an actual variable. I escaped the $ sign.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n  Write-Verbose -Message \"Ending  `$(`$myinvocation.mycommand)\"<br \/>\n[\/cc]<br \/>\nTo test, you can manually load the New-Function function into the ISE. Then, with an open script, run New-Function from the prompt. You should get prompted for a name and end up with something like this. I entered Get-Answers when prompted.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n #requires -version 2.0<\/p>\n<p># -----------------------------------------------------------------------------<br \/>\n# Script: Get-Answers.ps1<br \/>\n# Author: SERENITY\\Jeff<br \/>\n# Date: 9\/16\/2010<br \/>\n# Keywords:<br \/>\n# Comments:<br \/>\n#<br \/>\n# -----------------------------------------------------------------------------<\/p>\n<p>Function Get-Answers {<\/p>\n<p><#\n   .Synopsis\n    This does that \n    .Description\n    A longer explanation\n     .Parameter \n    The parameter\n   .Example\n    PS C:\\><br \/>\n    Example- accomplishes <\/p>\n<p>   .Notes<br \/>\n    NAME: Get-Answers<br \/>\n    VERSION: 1.0<br \/>\n    AUTHOR:  SERENITY\\Jeff<br \/>\n    LASTEDIT: 09\/16\/2010 08:59:46<\/p>\n<p>   .Link<br \/>\n    about_Windows_PowerShell_2.0<\/p>\n<p>   .Inputs<br \/>\n    [String]<\/p>\n<p>   .Outputs<\/p>\n<p>#><\/p>\n<p>[cmdletBinding()]<\/p>\n<p>Param(<br \/>\n[Parameter(Position=0,Mandatory=$False,<br \/>\nValueFromPipeline=$True)]<br \/>\n[string[]]$var<\/p>\n<p>)<\/p>\n<p>Begin {<br \/>\n    Write-Verbose -Message \"Starting  $($myinvocation.mycommand)\"<\/p>\n<p> } #close Begin<\/p>\n<p>Process {<br \/>\n    Foreach ($item in $var) {<\/p>\n<p>    }#close Foreach <\/p>\n<p> } #close process<\/p>\n<p>End {<br \/>\n    Write-Verbose -Message \"Ending  $($myinvocation.mycommand)\"<br \/>\n } #close End<\/p>\n<p>} #end Function<br \/>\n[\/cc]<br \/>\nBut since I don't want to always have to do that, I added a line in my ISE profile to first dot source the script.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n. c:\\scripts\\new-function.ps1<br \/>\n[\/cc]<br \/>\nThen I added a command to add an item to the Add-Ons menu.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add(\"New Function\",{New-Function},\"ALT+N\") | Out-Null<br \/>\n[\/cc]<br \/>\n<a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.png\" alt=\"\" title=\"ise-addons\" width=\"220\" height=\"155\" class=\"aligncenter size-full wp-image-934\" \/><\/a><br \/>\nNow, whenever I want to create a new function I can open a new window using Ctrl+N and then insert a new function with Alt+N.<br \/>\nDownload a copy of <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/New-function.txt' target=\"_blank\">New-function.ps1<\/a> and edit as necessary to meet your needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I showed how to add a menu choice to the PowerShell ISE to insert the current date and time. Today I have something even better. At least it&#8217;s something I&#8217;ve needed for awhile. I write a lot of advanced functions in PowerShell. I&#8217;m often cutting and pasting from previous scripts and generally not being&#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,75,8],"tags":[32,232,534],"class_list":["post-933","post","type-post","status-publish","format-standard","hentry","category-powershell-ise","category-powershell-v2-0","category-scripting","tag-functions","tag-ise","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PowerShell ISE New Function &#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\/933\/powershell-ise-new-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PowerShell ISE New Function &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Yesterday I showed how to add a menu choice to the PowerShell ISE to insert the current date and time. Today I have something even better. At least it&#039;s something I&#039;ve needed for awhile. I write a lot of advanced functions in PowerShell. I&#039;m often cutting and pasting from previous scripts and generally not being...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2010-09-16T13:09:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2010-09-16T13:28:37+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.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=\"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\\\/933\\\/powershell-ise-new-function\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"PowerShell ISE New Function\",\"datePublished\":\"2010-09-16T13:09:45+00:00\",\"dateModified\":\"2010-09-16T13:28:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/\"},\"wordCount\":534,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/ise-addons.png\",\"keywords\":[\"functions\",\"ISE\",\"PowerShell\"],\"articleSection\":[\"PowerShell ISE\",\"PowerShell v2.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/\",\"name\":\"PowerShell ISE New Function &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/ise-addons.png\",\"datePublished\":\"2010-09-16T13:09:45+00:00\",\"dateModified\":\"2010-09-16T13:28:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/ise-addons.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/ise-addons.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/933\\\/powershell-ise-new-function\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell ISE\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell-ise\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PowerShell ISE New Function\"}]},{\"@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":"PowerShell ISE New Function &#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\/933\/powershell-ise-new-function\/","og_locale":"en_US","og_type":"article","og_title":"PowerShell ISE New Function &#8226; The Lonely Administrator","og_description":"Yesterday I showed how to add a menu choice to the PowerShell ISE to insert the current date and time. Today I have something even better. At least it's something I've needed for awhile. I write a lot of advanced functions in PowerShell. I'm often cutting and pasting from previous scripts and generally not being...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/","og_site_name":"The Lonely Administrator","article_published_time":"2010-09-16T13:09:45+00:00","article_modified_time":"2010-09-16T13:28:37+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"PowerShell ISE New Function","datePublished":"2010-09-16T13:09:45+00:00","dateModified":"2010-09-16T13:28:37+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/"},"wordCount":534,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.png","keywords":["functions","ISE","PowerShell"],"articleSection":["PowerShell ISE","PowerShell v2.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/","name":"PowerShell ISE New Function &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.png","datePublished":"2010-09-16T13:09:45+00:00","dateModified":"2010-09-16T13:28:37+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell ISE","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},{"@type":"ListItem","position":2,"name":"PowerShell ISE New Function"}]},{"@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":1233,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1233\/friday-fun-convertto-text-file\/","url_meta":{"origin":933,"position":0},"title":"Friday Fun ConvertTo Text File","author":"Jeffery Hicks","date":"March 18, 2011","format":false,"excerpt":"When I'm working on simple PowerShell scripts, I find myself using the PowerShell ISE. When I need to share those scripts on my blog I inevitably need to save the script as a text file so I can post it. I finally realized that instead of the few manual steps,\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":[]},{"id":3990,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3990\/friday-fun-creating-powershell-scripts-with-powershell\/","url_meta":{"origin":933,"position":1},"title":"Friday Fun: Creating PowerShell Scripts with PowerShell","author":"Jeffery Hicks","date":"September 5, 2014","format":false,"excerpt":"Sometimes PowerShell really does seem like magic. Especially when you can use it to handle complicated or tedious tasks, such as creating a PowerShell script. I know many an IT Pro who want to script but without having to actually write a script. Well, I'm not sure that is realistic,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"012914_1704_CreatingCIM1.png","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/012914_1704_CreatingCIM1-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4305,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4305\/what-powershell-script-was-i-working-on\/","url_meta":{"origin":933,"position":2},"title":"What PowerShell Script Was I Working On?","author":"Jeffery Hicks","date":"March 24, 2015","format":false,"excerpt":"Last week I shared a script for finding recently modified files in a given directory. In fact, it wouldn't be that difficult to find the last files I was working on and open them in the PowerShell ISE. Assuming my Get-RecentFile function is loaded it is a simple as this:\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":4278,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/4278\/friday-fun-send-powershell-ise-content-to-word\/","url_meta":{"origin":933,"position":3},"title":"Friday Fun: Send PowerShell ISE Content to Word","author":"Jeffery Hicks","date":"March 13, 2015","format":false,"excerpt":"Yesterday on Facebook, Ed Wilson was lamenting about confusion of keyboard shortcuts between PowerShell and Microsoft Word. I've run into the same issue. Muscle memory is strong. Then the discussion turned to getting content from the PowerShell ISE into a Word document. I humorously suggested we had a plugin and\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"geek","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/01\/geek.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1292,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1292\/new-comment-help\/","url_meta":{"origin":933,"position":4},"title":"New Comment Help","author":"Jeffery Hicks","date":"March 29, 2011","format":false,"excerpt":"If you follow my blog I'm sure you noticed that I post a lot of advanced functions and scripts. While I don't expect every one to be developing advanced functions, the closer you can get the more powerful your work. With the Scripting Games approaching I thought I'd offer up\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\/2011\/03\/helpbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1645,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/1645\/friday-fun-add-a-print-menu-to-the-powershell-ise\/","url_meta":{"origin":933,"position":5},"title":"Friday Fun Add A Print Menu to the PowerShell ISE","author":"Jeffery Hicks","date":"September 9, 2011","format":false,"excerpt":"I spend a fair amount of time in the PowerShell ISE. One task that I find myself needing, especially lately, is the ability to print a script file. I'm sure you noticed there is no Print menu choice. So I decided to add my own to the ISE. Printing 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":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/933","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=933"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/933\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}