{"id":4332,"date":"2015-03-27T10:34:23","date_gmt":"2015-03-27T14:34:23","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4332"},"modified":"2015-03-25T14:41:55","modified_gmt":"2015-03-25T18:41:55","slug":"friday-fun-open-last-file-in-the-powershell-ise","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/","title":{"rendered":"Friday Fun: Open Last File in the PowerShell ISE"},"content":{"rendered":"<p>Over the last few articles I've been sharing some shortcuts to get most recently used or edited files. For today's Friday Fun I thought I'd share something that I use in my PowerShell ISE profile. Whenever I start the ISE, I automatically open the last file I was working on. Instead of launching the ISE and then finding the most recent file in list under File, this happens automatically.<\/p>\n<p>I found some information on this topic at PowerShell.com and revised it to meet my needs. The most recently used files are stored in an XML configuration file, which is good because I can use PowerShell to parse out the information I need. Unfortunately, the path to this file is pretty unwieldy:<\/p>\n<p>$env:LocalAppData\\microsoft_corporation\\powershell_ise.exe_StrongName_lw2v2vm3wmtzzpebq33gybmeoxukb04w\\3.0.0.0<\/p>\n<p>Which translates to something like this:<\/p>\n<p>C:\\Users\\Jeff\\AppData\\Local\\microsoft_corporation\\powershell_ise.exe_StrongName_lw2v2vm3wmtzzpebq33gybmeoxukb04w\\3.0.0.0<\/p>\n<p>The XML file is called user.config. With that, let's get some PowerShell in here to get the XML.<\/p>\n<pre><code>$path = \"C:\\Users\\Jeff\\AppData\\Local\\microsoft_corporation\\powershell_ise.exe_StrongName_lw2v2vm3wmtzzpebq33gybmeoxukb04w\\3.0.0.0\"\r\n$configpath = Join-path -path $path -ChildPath user.config\r\n[xml]$config = Get-Content $configpath<\/code><\/pre>\n<p>The recent used list is stored under user settings.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp1.png\" alt=\"\" \/><\/p>\n<p>The value should have what I need.<img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp2.png\" alt=\"\" \/><\/p>\n<p>Looks like it is an array of strings.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp3.png\" alt=\"\" \/><\/p>\n<p>Getting closer. It seems the last step I need is that string property.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp4.png\" alt=\"\" \/><\/p>\n<p>This should be the same list as I see under File. But while this works, it assumes that the setting I want will always be at position 5 and that I know how to get there in the first place. The smarter way is to use an XPATH filter to find the data. I can use the SelectNodes() method.<\/p>\n<pre><code>$config.SelectNodes('\/\/setting[@name=\"MRU\"]')<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp5.png\" alt=\"\" \/><\/p>\n<p>The query essentially says find any node that is a &lt;setting&gt; and that has a name attribute of \"MRU\". XML is case-sensitive so I have to match what is in the XML file.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp6.png\" alt=\"\" \/><\/p>\n<p>With this it is just as easy to get the most recent file.<\/p>\n<pre><code>$n = $config.SelectNodes('\/\/setting[@name=\"MRU\"]')\r\n$n.value.ArrayOfString.string | select -first 1<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp7.png\" alt=\"\" \/><\/p>\n<p>Once I know the file name it is trivial to load it into the ISE.<\/p>\n<pre><code>psedit $n.value.ArrayOfString.string[0]<\/code><\/pre>\n<p>The other way I could have selected the node is with Select-XML.<\/p>\n<pre><code>Select-Xml -Xml $config -XPath '\/\/setting[@name=\"MRU\"]'<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp8.png\" alt=\"\" \/><\/p>\n<p>The node property has the setting I need. I can simply keep drilling until I get the value I want.<\/p>\n<pre class=\"lang:ps decode:true \" >(Select-Xml -Xml $config -XPath '\/\/setting[@name=\"MRU\"]').node.Value.ArrayOfString.String[0]<\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp9.png\" alt=\"\" \/><\/p>\n<p>In this case I'm only selecting the first item. I could have used these code snippets in my profile, but I decided to create a function to retrieve the MRU list.<\/p>\n<pre class=\"lang:ps decode:true \" >Function Get-ISEMRU {\r\n\r\n[cmdletbinding()]\r\nParam()\r\n\r\n<#\r\nPath will be something like:\r\nC:\\Users\\Jeff\\AppData\\Local\\microsoft_corporation\\powershell_ise.exe_StrongName_lw2v2vm3wmtzzpebq33gybmeoxukb04w\r\n#>\r\n$ISEPath = \"$env:localappdata\\microsoft_corporation\\powershell_ise*\\3.0.0.0\"\r\n\r\nTry {\r\n$folder = (Resolve-Path -Path $ISEPath -ErrorAction Stop).Path\r\n}\r\nCatch {\r\nWrite-Warning \"Failed to get ISE folder from $ISEPath\"\r\nWrite-Warning $_.exception.message\r\n#Bail out\r\nReturn\r\n}\r\n\r\nIf ($folder) {\r\n#construct the path to user.config\r\n$path = Join-Path -Path $folder -ChildPath \"user.config\"\r\n\r\n#verify the file exists just in case\r\nif (Test-Path -path $path) {\r\n#using -Raw sends everything at once as a huge string\r\n#and boosts performance a bit.\r\n[xml]$xml = Get-Content -Path $path -Raw\r\n\r\n#get the MRU setting as a string using an XPath filter\r\n$xml.SelectNodes('\/\/setting[@name=\"MRU\"]').Value.ArrayOfString.string\r\n}\r\nelse {\r\nWrite-Warning \"Can't find $path\"\r\n}\r\n} #if $folder\r\n\r\n} #end Get-ISEMRU<\/pre>\n<p>The function encapsulates everything I've shown you. Although I set a default path using a wildcard.<\/p>\n<pre><code>$ISEPath = \"$env:localappdata\\microsoft_corporation\\powershell_ise*\\3.0.0.0\"<\/code><\/pre>\n<p>I did this to keep things easier to read and on the off chance that the strong name value might change at some point. By the way I am running this on PowerShell 4.0. I have not tested with v5.<\/p>\n<p>To get the full path, I can resolve this path with a wildcard.<\/p>\n<pre><code>$folder = (Resolve-Path -Path $ISEPath -ErrorAction Stop).Path<\/code><\/pre>\n<p>Most everthing else is the same. This function is in my PowerShell ISE profile script and at the end I open the most recent file.<\/p>\n<pre><code>#open the most recently edited file\r\npsedit (Get-ISEMRU)[0]<\/code><\/pre>\n<p>It's that easy. And because the function is in my profile, I can run it anytime. Although note that the XML file won't get updated until you close the ISE. Personally, all these little things add up over the course of a day and make my work a bit more fun. Enjoy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last few articles I&#8217;ve been sharing some shortcuts to get most recently used or edited files. For today&#8217;s Friday Fun I thought I&#8217;d share something that I use in my PowerShell ISE profile. Whenever I start the ISE, I automatically open the last file I was working on. Instead of launching the ISE&#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 Friday Fun: Open Last File Automagically in the #PowerShell ISE","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":[271,4,8],"tags":[568,534,567,206],"class_list":["post-4332","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","category-scripting","tag-friday-fun","tag-powershell","tag-powershell-ise","tag-xml"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: Open Last File in the PowerShell ISE &#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\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Open Last File in the PowerShell ISE &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Over the last few articles I&#039;ve been sharing some shortcuts to get most recently used or edited files. For today&#039;s Friday Fun I thought I&#039;d share something that I use in my PowerShell ISE profile. Whenever I start the ISE, I automatically open the last file I was working on. Instead of launching the ISE...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2015-03-27T14:34:23+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp1.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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Open Last File in the PowerShell ISE\",\"datePublished\":\"2015-03-27T14:34:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/\"},\"wordCount\":561,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/032515_1834_FridayFunOp1.png\",\"keywords\":[\"Friday Fun\",\"PowerShell\",\"PowerShell ISE\",\"xml\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/\",\"name\":\"Friday Fun: Open Last File in the PowerShell ISE &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/032515_1834_FridayFunOp1.png\",\"datePublished\":\"2015-03-27T14:34:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/032515_1834_FridayFunOp1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/032515_1834_FridayFunOp1.png\",\"width\":808,\"height\":127},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4332\\\/friday-fun-open-last-file-in-the-powershell-ise\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Open Last File in the PowerShell ISE\"}]},{\"@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: Open Last File in the PowerShell ISE &#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\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Open Last File in the PowerShell ISE &#8226; The Lonely Administrator","og_description":"Over the last few articles I've been sharing some shortcuts to get most recently used or edited files. For today's Friday Fun I thought I'd share something that I use in my PowerShell ISE profile. Whenever I start the ISE, I automatically open the last file I was working on. Instead of launching the ISE...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/","og_site_name":"The Lonely Administrator","article_published_time":"2015-03-27T14:34:23+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp1.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Open Last File in the PowerShell ISE","datePublished":"2015-03-27T14:34:23+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/"},"wordCount":561,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp1.png","keywords":["Friday Fun","PowerShell","PowerShell ISE","xml"],"articleSection":["Friday Fun","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/","name":"Friday Fun: Open Last File in the PowerShell ISE &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp1.png","datePublished":"2015-03-27T14:34:23+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/032515_1834_FridayFunOp1.png","width":808,"height":127},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4332\/friday-fun-open-last-file-in-the-powershell-ise\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Open Last File in the PowerShell ISE"}]},{"@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":2673,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2673\/friday-fun-edit-recent-file\/","url_meta":{"origin":4332,"position":0},"title":"Friday Fun: Edit Recent File","author":"Jeffery Hicks","date":"January 4, 2013","format":false,"excerpt":"As you might imagine I work on a lot of PowerShell projects at the same time. Sometimes I'll start something at the beginning of the week and then need to come back to it at the end of the week. The problem is that I can't always remembered what I\u2026","rel":"","context":"In &quot;Powershell 3.0&quot;","block_context":{"text":"Powershell 3.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-3-0\/"},"img":{"alt_text":"Edit-RecentFile","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/Edit-RecentFile-300x209.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3562,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3562\/friday-fun-theme-me-up\/","url_meta":{"origin":4332,"position":1},"title":"Friday Fun: Theme Me Up!","author":"Jeffery Hicks","date":"November 15, 2013","format":false,"excerpt":"When PowerShell 3.0 came out, one of the compelling features was a re-vamped PowerShell ISE. Options in the ISE included the ability to fine-tune and customize the appearance including items like font, token colors, and screen colors. If I recall correctly, in PowerShell 2.0, if you wanted to customize the\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"crayons","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/crayons-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1233,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1233\/friday-fun-convertto-text-file\/","url_meta":{"origin":4332,"position":2},"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":1645,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/1645\/friday-fun-add-a-print-menu-to-the-powershell-ise\/","url_meta":{"origin":4332,"position":3},"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":[]},{"id":2471,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/2471\/friday-fun-save-all-open-powershell-ise-files\/","url_meta":{"origin":4332,"position":4},"title":"Friday Fun: Save All Open PowerShell ISE Files","author":"Jeffery Hicks","date":"August 3, 2012","format":false,"excerpt":"Here's a little tidbit that I previously shared on Twitter and Google Plus. The PowerShell ISE obviously has a Save menu choice. But there's no menu option to save all open files. But you can add one yourself. All of the open files are part of the $psise.CurrentPowerShellTab.Files collection. Each\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":1584,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1584\/friday-fun-add-scripting-signing-to-the-ise\/","url_meta":{"origin":4332,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4332","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=4332"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4332\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}