{"id":1270,"date":"2011-03-25T09:00:51","date_gmt":"2011-03-25T13:00:51","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1270"},"modified":"2011-03-28T08:21:48","modified_gmt":"2011-03-28T12:21:48","slug":"friday-fun-create-numbered-file","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/","title":{"rendered":"Friday Fun Create Numbered File"},"content":{"rendered":"<p>I was working on my guest commentary for the upcoming Scripting Games and started thinking I would need a line numbered version of my solution to help explain. Turns out I didn't go down that road, but in the process I put together a little PowerShell to take a text file and create a line numbered version.<!--more--><\/p>\n<p>When you are editing a file in the ISE or a script editor like PrimalScript, line numbers help you quickly jump to trouble spots with parsing errors. I decided it would be equally helpful to create a line numbered version of a script. Here's what I came up with, appropriately numbered.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n 1  #Requires -version 2.0<br \/>\n 2<br \/>\n 3  # -----------------------------------------------------------------------------<br \/>\n 4  # Script: ConvertTo-NumberedText.ps1<br \/>\n 5  # Version: 1.0<br \/>\n 6  # Author: Jeffery Hicks<br \/>\n 7  #    http:\/\/jdhitsolutions.com\/blog<br \/>\n 8  #    http:\/\/twitter.com\/JeffHicks<br \/>\n 9  # Date: 3\/22\/2011<br \/>\n10  # Keywords:<br \/>\n11  # Comments:<br \/>\n12  #<br \/>\n13  # \"Those who forget to script are doomed to repeat their work.\"<br \/>\n14  #<br \/>\n15  #  ****************************************************************<br \/>\n16  #  * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED *<br \/>\n17  #  * THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK.  IF   *<br \/>\n18  #  * YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, *<br \/>\n19  #  * DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.             *<br \/>\n20  #  ****************************************************************<br \/>\n21  # -----------------------------------------------------------------------------<br \/>\n22<br \/>\n23  $File=Read-Host \"Enter the name of the file to convert to numbered output\"<br \/>\n24  $Output=Read-Host \"Enter the name of the output file\"<br \/>\n25<br \/>\n26  if (Test-Path -Path $file)<br \/>\n27  {<br \/>\n28      #read in the total contents of the file<br \/>\n29      $Content=get-content -Path $file<br \/>\n30<br \/>\n31      #get the total number of lines<br \/>\n32      $count=$content.Count<br \/>\n33<br \/>\n34      #convert the count to a string so we can find how many digits. This will<br \/>\n35      #be the padding value<br \/>\n36      $Pad=$count.ToString().Length<br \/>\n37<br \/>\n38      #initialize a counter<br \/>\n39      $i=1<br \/>\n40<br \/>\n41      #pipe the content to ForEach, building a new numbered line and pipe the results to a new<br \/>\n42      #file. The new lines are then piped to Out-File.<br \/>\n43      $content | foreach {<br \/>\n44        #use the -f operaton to construct a string with a padded line number<br \/>\n45        #and the line.<br \/>\n46        \"{0}  {1}\" -f $i.ToString().PadLeft($pad),$_<br \/>\n47<br \/>\n48        #increment the counter<br \/>\n49        $i++<br \/>\n50        } | Out-File -FilePath $Output<br \/>\n51<br \/>\n52        Write-Host \"Open $Output for numbered content.\" -ForegroundColor Green<br \/>\n53  } #if<br \/>\n54  else<br \/>\n55  {<br \/>\n56      Write-Warning \"Can't find or verify $file.\"<br \/>\n57  }<br \/>\n[\/cc]<\/p>\n<p>I decided to keep things really simple and prompt the user in lines 23\/24 for the script to convert and the new file name.<\/p>\n<p>Line 26 is a quick test to verify the source file exits. If it does, then the entire contents are saved to a variable (line 29). Now the fun part.<\/p>\n<p>I wanted the line numbers to be justified like they are in the ISE. If my script has 134 lines then the first 9 lines needed to be indented 2 spaces and lines 10-99 indented 1.  Assuming the script has more than 1 line (otherwise why are you bothering with this?), I get the total line count in  line 32.<\/p>\n<p>To determine how much padding I'll need, I'll convert this number to a string and get its length (line 36). Armed with this value, I can now go through each line of content (line 43) and construct a new line using the -f operator (line 46).  The value of the first placeholder will be the counter value (starting at 1 (line 39)), converted to a string and then padded the necessary number of spaces. The second element is the original line from the imported content.<\/p>\n<p>All that remains is to send the output to the new file in line 50. The main section of the script ends with a message in line 52.<\/p>\n<p>I doubt you'll need this often but if nothing else it offers a few lessons in the string object and the -f operator.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/03\/ConvertTo-NumberedText.txt' target='_blank'>ConvertTo-NumberedText<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was working on my guest commentary for the upcoming Scripting Games and started thinking I would need a line numbered version of my solution to help explain. Turns out I didn&#8217;t go down that road, but in the process I put together a little PowerShell to take a text file and create a line&#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":[271,231,75,8],"tags":[270,102,534,540],"class_list":["post-1270","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell-ise","category-powershell-v2-0","category-scripting","tag-foreach","tag-get-content","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun Create Numbered File &#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\/1270\/friday-fun-create-numbered-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun Create Numbered File &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I was working on my guest commentary for the upcoming Scripting Games and started thinking I would need a line numbered version of my solution to help explain. Turns out I didn&#039;t go down that road, but in the process I put together a little PowerShell to take a text file and create a line...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-03-25T13:00:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-03-28T12:21:48+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\\\/1270\\\/friday-fun-create-numbered-file\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun Create Numbered File\",\"datePublished\":\"2011-03-25T13:00:51+00:00\",\"dateModified\":\"2011-03-28T12:21:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/\"},\"wordCount\":582,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"ForEach\",\"Get-Content\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell ISE\",\"PowerShell v2.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/\",\"name\":\"Friday Fun Create Numbered File &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-03-25T13:00:51+00:00\",\"dateModified\":\"2011-03-28T12:21:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1270\\\/friday-fun-create-numbered-file\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun Create Numbered File\"}]},{\"@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":"Friday Fun Create Numbered File &#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\/1270\/friday-fun-create-numbered-file\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun Create Numbered File &#8226; The Lonely Administrator","og_description":"I was working on my guest commentary for the upcoming Scripting Games and started thinking I would need a line numbered version of my solution to help explain. Turns out I didn't go down that road, but in the process I put together a little PowerShell to take a text file and create a line...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-03-25T13:00:51+00:00","article_modified_time":"2011-03-28T12:21:48+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\/1270\/friday-fun-create-numbered-file\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun Create Numbered File","datePublished":"2011-03-25T13:00:51+00:00","dateModified":"2011-03-28T12:21:48+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/"},"wordCount":582,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["ForEach","Get-Content","PowerShell","Scripting"],"articleSection":["Friday Fun","PowerShell ISE","PowerShell v2.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/","name":"Friday Fun Create Numbered File &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-03-25T13:00:51+00:00","dateModified":"2011-03-28T12:21:48+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1270\/friday-fun-create-numbered-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun Create Numbered File"}]},{"@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":1584,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1584\/friday-fun-add-scripting-signing-to-the-ise\/","url_meta":{"origin":1270,"position":0},"title":"Friday Fun Add Scripting Signing to the ISE","author":"Jeffery Hicks","date":"August 5, 2011","format":false,"excerpt":"Today's fun involves adding a menu item to the PowerShell ISE to make it easy to sign your scripts. I'm not going to go into the details about getting and installing a code signing certificate. I also assume you only have one installed. You can get this certificate by seasrching\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":1729,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1729\/ise-scripting-geek-module\/","url_meta":{"origin":1270,"position":1},"title":"ISE Scripting Geek Module","author":"Jeffery Hicks","date":"October 27, 2011","format":false,"excerpt":"Over the last year I've posted functions I've written to extend the Windows PowerShell ISE. I have finally pulled everything together into a module I'm calling the ISE Scripting Geek. Download and extract the zip file (below) to your modules folder. You should end up with a path like 'C:\\Users\\Jeff\\Documents\\WindowsPowerShell\\Modules\\ISEScriptingGeek'.\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"ISE Scripting Geek add-on menu","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/isescriptinggeek-300x200.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":445,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/445\/more-fun-with-get-numberedcontent\/","url_meta":{"origin":1270,"position":2},"title":"More Fun with Get-NumberedContent","author":"Jeffery Hicks","date":"October 13, 2009","format":false,"excerpt":"As much fun as the original Get-NumberedContent function was after using it for awhile I realized I had imposed some limitations. I also realized it needed to be more flexible. What if someone wanted to specify a different color or use a different comment character such as a ; in\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":"Help Get-NumberedContent","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/10\/captured_Image2.png_thumb2.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2330,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2330\/friday-fun-get-latest-powershell-scripts\/","url_meta":{"origin":1270,"position":3},"title":"Friday Fun: Get Latest PowerShell Scripts","author":"Jeffery Hicks","date":"May 18, 2012","format":false,"excerpt":"Probably like many of you I keep almost all of my scripts in a single location. I'm also usually working on multiple items at the same time. Some times I have difficult remembering the name of a script I might have been working on a few days ago that I\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":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/05\/get-latestscript-300x133.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":1270,"position":4},"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":933,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/933\/powershell-ise-new-function\/","url_meta":{"origin":1270,"position":5},"title":"PowerShell ISE New Function","author":"Jeffery Hicks","date":"September 16, 2010","format":false,"excerpt":"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\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":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/ise-addons.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1270","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=1270"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1270\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}