{"id":105,"date":"2007-03-02T10:21:00","date_gmt":"2007-03-02T14:21:00","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2007\/03\/02\/get-latest-file\/"},"modified":"2013-07-02T08:13:07","modified_gmt":"2013-07-02T12:13:07","slug":"get-latest-file","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/","title":{"rendered":"Get Latest File"},"content":{"rendered":"<p>I was helping out in the MSN Groups scripting forum recently. The admin needed to find the latest file or most recently modified file in a folder. That sounded reasonable to me so I put together a function and short script that uses it.  I thought I'd share it here:<\/p>\n<p><\/p>\n<pre class=\"csharpcode\"><span class=\"rem\">'GetLatestFile.vbs<\/span><br \/>strDir=<span class=\"str\">\"S:\"<\/span><br \/>WScript.Echo <span class=\"str\">\"The newest file is \"<\/span> &amp; GetLatestFile(strDir)<br \/><br \/><span class=\"kwrd\">Function<\/span> GetLatestFile(strDir)<br \/><span class=\"rem\">'Returns the full path and file name of the file that<\/span><br \/><span class=\"rem\">'was most recently modified. This function will Not<\/span><br \/><span class=\"rem\">'recurse through subdirectories.<\/span><br \/><br \/><span class=\"kwrd\">On<\/span> <span class=\"kwrd\">Error<\/span> <span class=\"kwrd\">Resume<\/span> <span class=\"kwrd\">Next<\/span><br \/><span class=\"kwrd\">Set<\/span> objFSO=CreateObject(<span class=\"str\">\"Scripting.FileSystemObject\"<\/span>)<br \/><span class=\"kwrd\">If<\/span> objFSO.FolderExists(strDir) <span class=\"kwrd\">Then<\/span><br \/><br \/>    <span class=\"kwrd\">Set<\/span> objFldr=objFSO.GetFolder(strDir)<br \/>    <span class=\"kwrd\">Set<\/span> colFiles=objFldr.Files<br \/>    <br \/>    strLatest=<span class=\"str\">\"\"<\/span><br \/>    dtLatest=<span class=\"str\">\"01\/01\/1900 12:00:00 AM\"<\/span><br \/>    <br \/>    <span class=\"kwrd\">For<\/span> <span class=\"kwrd\">Each<\/span> file <span class=\"kwrd\">In<\/span> colFiles<br \/>        <span class=\"kwrd\">If<\/span> <span class=\"kwrd\">CDate<\/span>(file.DateLastModified) &gt; <span class=\"kwrd\">CDate<\/span>(dtLatest) <span class=\"kwrd\">Then<\/span> <br \/>        strLatest=file.path<br \/>        dtLatest=file.DateLastModified<br \/>        <span class=\"kwrd\">End<\/span> <span class=\"kwrd\">If<\/span><br \/>    <span class=\"kwrd\">Next<\/span><br \/>    <br \/>    GetLatestFile=strLatest<br \/><span class=\"kwrd\">Else<\/span><br \/>    GetLatestFile=<span class=\"str\">\"Directory Not Found\"<\/span><br \/><span class=\"kwrd\">End<\/span> <span class=\"kwrd\">If<\/span><br \/><br \/><span class=\"kwrd\">End<\/span> <span class=\"kwrd\">Function<\/span><br \/><\/pre>\n<pre class=\"csharpcode\">&nbsp;<\/pre>\n<p><\/p>\n<p><\/p>\n<style type=\"text\/css\">.csharpcode, .csharpcode pre<br \/>{<br \/> font-size: small;<br \/> color: black;<br \/> font-family: consolas, \"Courier New\", courier, monospace;<br \/> background-color: #ffffff;<br \/> \/*white-space: pre;*\/<br \/>}<br \/>.csharpcode pre { margin: 0em; }<br \/>.csharpcode .rem { color: #008000; }<br \/>.csharpcode .kwrd { color: #0000ff; }<br \/>.csharpcode .str { color: #006080; }<br \/>.csharpcode .op { color: #0000c0; }<br \/>.csharpcode .preproc { color: #cc6633; }<br \/>.csharpcode .asp { background-color: #ffff00; }<br \/>.csharpcode .html { color: #800000; }<br \/>.csharpcode .attr { color: #ff0000; }<br \/>.csharpcode .alt <br \/>{<br \/> background-color: #f4f4f4;<br \/> width: 100%;<br \/> margin: 0em;<br \/>}<br \/>.csharpcode .lnum { color: #606060; }<br \/><\/style>\n<p>The real \"trick\" to the script is to convert the DateLastModified property to a Date using CDate. Otherwise, the script tries to compare strings and you get some pretty weird and unexpected results. As written, this function will not recurse through subdirectories. Although you could make that modification.&nbsp; It also searches all file types.&nbsp; If you wanted to be more restrictive, say find the last Word document, you could either parse out the extension from the filename and only check .DOC or you could check the Type property of the file. This property will be something like \"Microsoft Office Word 97 - 2003 Document\".<\/p>\n<p><\/p>\n<p>You could also modify this function to return all files that had been modified since a certain date. Here's one possible modification:<\/p>\n<p><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"csharpcode\">dtCutOff=<span class=\"str\">\"02\/15\/2007 12:00:00 AM\"<\/span><br \/>    <br \/>    <span class=\"kwrd\">For<\/span> <span class=\"kwrd\">Each<\/span> file <span class=\"kwrd\">In<\/span> colFiles<br \/>        <span class=\"kwrd\">If<\/span> <span class=\"kwrd\">CDate<\/span>(file.DateLastModified) &gt; <span class=\"kwrd\">CDate<\/span>(dtCutoff) <span class=\"kwrd\">Then<\/span> <br \/>        strLatest=strLatest &amp; <span class=\"str\">\",\"<\/span> &amp; file.path<br \/>        <span class=\"kwrd\">End<\/span> <span class=\"kwrd\">If<\/span><br \/>    <span class=\"kwrd\">Next<\/span><br \/>    <br \/>    <span class=\"rem\">'strip off leading comma<\/span><br \/>    strLatest=Mid(strLatest,2)<br \/>    GetLatestFile=strLatest<\/pre>\n<p><\/p>\n<p><\/p>\n<style type=\"text\/css\">.csharpcode, .csharpcode pre<br \/>{<br \/> font-size: small;<br \/> color: black;<br \/> font-family: consolas, \"Courier New\", courier, monospace;<br \/> background-color: #ffffff;<br \/> \/*white-space: pre;*\/<br \/>}<br \/>.csharpcode pre { margin: 0em; }<br \/>.csharpcode .rem { color: #008000; }<br \/>.csharpcode .kwrd { color: #0000ff; }<br \/>.csharpcode .str { color: #006080; }<br \/>.csharpcode .op { color: #0000c0; }<br \/>.csharpcode .preproc { color: #cc6633; }<br \/>.csharpcode .asp { background-color: #ffff00; }<br \/>.csharpcode .html { color: #800000; }<br \/>.csharpcode .attr { color: #ff0000; }<br \/>.csharpcode .alt <br \/>{<br \/> background-color: #f4f4f4;<br \/> width: 100%;<br \/> margin: 0em;<br \/>}<br \/>.csharpcode .lnum { color: #606060; }<br \/><\/style>\n<p>Now you'll get a comma separated list of all files that have been modified since 2\/15\/2007.<\/p>\n<p>So kick it around.  If you come up with some tweaks, post a comment.<\/p>\n<\/p>\n<p><\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:583b623f-6a05-42ef-8ba7-b12940bd35f0\" contenteditable=\"false\" style=\"margin: 0px; padding: 0px; display: inline;\"><span style=\"font-size:85%;\">Technorati tags: <a href=\"http:\/\/technorati.com\/tags\/VBScript\" rel=\"tag\">VBScript<\/a>, <a href=\"http:\/\/technorati.com\/tags\/Scripting\" rel=\"tag\">Scripting<\/a>, FileSystemObject, <a href=\"http:\/\/technorati.com\/tags\/Functions\" rel=\"tag\">Functions<\/a><\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I was helping out in the MSN Groups scripting forum recently. The admin needed to find the latest file or most recently modified file in a folder. That sounded reasonable to me so I put together a function and short script that uses it. I thought I&#8217;d share it here: &#8216;GetLatestFile.vbsstrDir=&#8221;S:&#8221;WScript.Echo &#8220;The newest file is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","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":[8],"tags":[37,32,535],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-filesystemobject","tag-functions","tag-vbscript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get Latest 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\/105\/get-latest-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Latest File &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I was helping out in the MSN Groups scripting forum recently. The admin needed to find the latest file or most recently modified file in a folder. That sounded reasonable to me so I put together a function and short script that uses it. I thought I&#039;d share it here: &#039;GetLatestFile.vbsstrDir=&quot;S:&quot;WScript.Echo &quot;The newest file is...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2007-03-02T14:21:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-07-02T12:13:07+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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get Latest File\",\"datePublished\":\"2007-03-02T14:21:00+00:00\",\"dateModified\":\"2013-07-02T12:13:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/\"},\"wordCount\":218,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"FileSystemObject\",\"functions\",\"VBScript\"],\"articleSection\":[\"Scripting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/\",\"name\":\"Get Latest File &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2007-03-02T14:21:00+00:00\",\"dateModified\":\"2013-07-02T12:13:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/105\\\/get-latest-file\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Scripting\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/scripting\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Latest 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":"Get Latest 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\/105\/get-latest-file\/","og_locale":"en_US","og_type":"article","og_title":"Get Latest File &#8226; The Lonely Administrator","og_description":"I was helping out in the MSN Groups scripting forum recently. The admin needed to find the latest file or most recently modified file in a folder. That sounded reasonable to me so I put together a function and short script that uses it. I thought I'd share it here: 'GetLatestFile.vbsstrDir=\"S:\"WScript.Echo \"The newest file is...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/","og_site_name":"The Lonely Administrator","article_published_time":"2007-03-02T14:21:00+00:00","article_modified_time":"2013-07-02T12:13:07+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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get Latest File","datePublished":"2007-03-02T14:21:00+00:00","dateModified":"2013-07-02T12:13:07+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/"},"wordCount":218,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["FileSystemObject","functions","VBScript"],"articleSection":["Scripting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/","name":"Get Latest File &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2007-03-02T14:21:00+00:00","dateModified":"2013-07-02T12:13:07+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/105\/get-latest-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Scripting","item":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},{"@type":"ListItem","position":2,"name":"Get Latest 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":2673,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2673\/friday-fun-edit-recent-file\/","url_meta":{"origin":105,"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":4305,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4305\/what-powershell-script-was-i-working-on\/","url_meta":{"origin":105,"position":1},"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":1584,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1584\/friday-fun-add-scripting-signing-to-the-ise\/","url_meta":{"origin":105,"position":2},"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":8622,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8622\/finding-modified-files-with-powershell\/","url_meta":{"origin":105,"position":3},"title":"Finding Modified Files with PowerShell","author":"Jeffery Hicks","date":"October 14, 2021","format":false,"excerpt":"Here's another task that I seem to be constantly fiddling with using PowerShell. What files did I work on yesterday? Or what files were modified in the last 48 hours? Obviously, Get-ChildItem is going to be the primary command. It is simple enough to get files based on an extension\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\/10\/extension-report.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/extension-report.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/extension-report.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":703,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/703\/export-function\/","url_meta":{"origin":105,"position":4},"title":"Export-Function","author":"Jeffery Hicks","date":"July 19, 2010","format":false,"excerpt":"I love that you can do so much with PowerShell on the fly.\u00a0 For example, I don\u2019t need to launch a script editor to create a PowerShell function. I can do it right from the command prompt. PS C:\\> function tm {(get-date).ToLongTimeString()} PS C:\\> tm 12:41:27 PM As long as\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":2090,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2090\/morning-report-revised\/","url_meta":{"origin":105,"position":5},"title":"Morning Report Revised","author":"Jeffery Hicks","date":"February 13, 2012","format":false,"excerpt":"Last month I posted a PowerShell script I called The Morning Report. I received some very nice feedback. One comment was about making it easier to use the script in a pipelined expression. For example, get a list of computers from a text file and create a single HTML report.\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/02\/morningreport-revised-300x126.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/105","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=105"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}