{"id":3685,"date":"2014-02-14T10:47:59","date_gmt":"2014-02-14T15:47:59","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3685"},"modified":"2014-02-14T10:47:59","modified_gmt":"2014-02-14T15:47:59","slug":"friday-fun-the-measure-of-a-file","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/","title":{"rendered":"Friday Fun: The Measure of a File"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-3686\" alt=\"ruler\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler-150x150.png\" width=\"150\" height=\"150\" \/><\/a> I've been working with PowerShell since the days of Monad and have written a lot of PowerShell scripts. Out of idle curiosity, and the need for a Friday Fun topic, I decided to see how many lines of PowerShell I have written. Or at least that are in my Scripts folder. Turns out I have 2003 ps1 files for a total of 143,375 lines of PowerShell. There's a bit of a fudge factor here has I often break single and long PowerShell expressions into multiple lines. So the number is an approximation. Here's how I figured this out.<\/p>\n<p>The Measure-Object cmdlet can also be used to measure text files. You can get values like total number of words, characters and lines. All you need to do is pipe content to the cmdlet.<\/p>\n<pre class=\"lang:batch decode:true\">PS C:\\&gt; get-content C:\\scripts\\Measure-ScriptLines.ps1 | measure-object -Line -Word -Character\r\n\r\n                   Lines                    Words               Characters Property\r\n                   -----                    -----               ---------- --------\r\n                      14                       41                      429<\/pre>\n<p>So to measure, let's say all of the script files I've created this year I can run a command like this:<\/p>\n<pre class=\"lang:batch decode:true\">PS C:\\&gt; dir c:\\scripts\\*.ps1 | where { $_.CreationTime -ge [datetime]\"1\/1\/2014\"} | get-content | measure -Line -IgnoreWhiteSpace\r\n\r\nLines Words                    Characters              Property           ----- -----                    ----------              --------           2860\r\n<\/pre>\n<p>I included the parameter to skip blank lines. But I wanted a bit more information such as the total number of files and perhaps an average so I came up with this code.<\/p>\n<pre class=\"lang:ps decode:true \" >\r\ndir c:\\scripts\\*.ps1 -recurse -ov a | \r\nget-content | \r\nmeasure -Line -IgnoreWhiteSpace | \r\nSelect Lines,\r\n@{Name=\"TotalFiles\";Expression={$a.count}},\r\n@{Name=\"Avg\";Expression={$_.lines\/$a.count}}<\/pre>\n<p>When you use Measure-Object with the text parameters, you don't get a count property like you normally would. So I'm using one of the common parameters, OutVariable, which has an alias of OV, with Get-Childitem (the dir command). When using Out-Variable, the results are written to the pipeline and to the variable. This means I can use this variable later in my expression to create custom properties for the TotalFiles and Average.<\/p>\n<pre class=\"lang:batch decode:true \" >\r\nLines                       TotalFiles                             Avg\r\n-----                       ----------                             ---\r\n143375                             2003                71.5801298052921\r\n<\/pre>\n<p>Let's say I want the same results for all files created this year. I'll need to move my capture variable later in the expression:<\/p>\n<pre class=\"lang:ps decode:true \" >\r\ndir c:\\scripts\\*.ps1 | where { $_.CreationTime -ge [datetime]\"1\/1\/2014\"} -ov a | \r\nget-content | \r\nmeasure -Line -IgnoreWhiteSpace | \r\nSelect Lines,\r\n@{Name=\"TotalFiles\";Expression={$a.count}},\r\n@{Name=\"Avg\";Expression={$_.lines\/$a.count}}<\/pre>\n<p>I need to make sure my count and averages are based on the filtered results. <\/p>\n<pre class=\"lang:batch decode:true \" > Lines                       TotalFiles                              Avg\r\n -----                       ----------                              ---\r\n  2860                               24                 119.166666666667<\/pre>\n<p>Or I can include unfiltered results as well.<\/p>\n<pre class=\"lang:batch decode:true \" >\r\nPS C:\\&gt; dir c:\\scripts\\*.ps1 -Recurse -ov All | where { $_.CreationTime -ge [datetime]\"1\/1\/2014\"} -ov Filtered | \r\nget-content | \r\nmeasure -Line -IgnoreWhiteSpace | \r\nSelect Lines,\r\n@{Name=\"TotalAllFiles\";Expression={$All.count}},\r\n@{Name=\"TotalFiltered\";Expression={$Filtered.count}},\r\n@{Name=\"PctTotal\";Expression={($filtered.count\/$All.count)*100}},\r\n@{Name=\"Avg\";Expression={$_.lines\/$Filtered.count}}\r\n\r\n\r\nLines         : 2860\r\nTotalAllFiles : 2003\r\nTotalFiltered : 24\r\nPctTotal      : 1.19820269595607\r\nAvg           : 119.166666666667<\/pre>\n<p>I've added OutVariable to the first part of my expression. I also went ahead and used more meaningful variable names. Since I had the data, I decided to add a bit more data. Finally, even though I've primarily been using the count value for the variables, they hold full objects which leads to some intriguing possibilities:<\/p>\n<pre class=\"lang:batch decode:true \" >PS C:\\&gt; dir c:\\scripts\\*.ps1 -Recurse -ov All | where { $_.CreationTime -ge [datetime]\"1\/1\/2014\"} -ov Filtered | \r\nget-content | \r\nmeasure -Line -IgnoreWhiteSpace | \r\nSelect Lines,\r\n@{Name=\"TotalAllFiles\";Expression={$All.count}},\r\n@{Name=\"TotalAllKB\";Expression={ ($all | Measure-Object -Property length -sum).sum\/1KB }},\r\n@{Name=\"TotalFiltered\";Expression={$Filtered.count}},\r\n@{Name=\"TotalFilteredKB\";Expression={ ($Filtered | Measure-Object -Property length -sum).sum\/1KB }},\r\n@{Name=\"PctTotal\";Expression={($filtered.count\/$All.count)*100}},\r\n@{Name=\"AvgLines\";Expression={$_.lines\/$Filtered.count}}\r\n\r\n\r\nLines           : 2860\r\nTotalAllFiles   : 2003\r\nTotalAllKB      : 6865.7890625\r\nTotalFiltered   : 24\r\nTotalFilteredKB : 496.4453125\r\nPctTotal        : 1.19820269595607\r\nAvgLines        : 119.166666666667<\/pre>\n<p>So today's fun really covered two topics, using Measure-Object with text files and the OutVariable common parameter. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working with PowerShell since the days of Monad and have written a lot of PowerShell scripts. Out of idle curiosity, and the need for a Friday Fun topic, I decided to see how many lines of PowerShell I have written. Or at least that are in my Scripts folder. Turns out I have&#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: The Measure of a File http:\/\/wp.me\/p1nF6U-Xr  #PowerShell","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,178,534],"class_list":["post-3685","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","category-scripting","tag-friday-fun","tag-measure-object","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: The Measure of a 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\/powershell\/3685\/friday-fun-the-measure-of-a-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: The Measure of a File &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve been working with PowerShell since the days of Monad and have written a lot of PowerShell scripts. Out of idle curiosity, and the need for a Friday Fun topic, I decided to see how many lines of PowerShell I have written. Or at least that are in my Scripts folder. Turns out I have...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-02-14T15:47:59+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler-150x150.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\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: The Measure of a File\",\"datePublished\":\"2014-02-14T15:47:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/\"},\"wordCount\":396,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/ruler-150x150.png\",\"keywords\":[\"Friday Fun\",\"Measure-Object\",\"PowerShell\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/\",\"name\":\"Friday Fun: The Measure of a File &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/ruler-150x150.png\",\"datePublished\":\"2014-02-14T15:47:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-file\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/ruler.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/ruler.png\",\"width\":194,\"height\":159},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3685\\\/friday-fun-the-measure-of-a-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: The Measure of a 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: The Measure of a 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\/powershell\/3685\/friday-fun-the-measure-of-a-file\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: The Measure of a File &#8226; The Lonely Administrator","og_description":"I've been working with PowerShell since the days of Monad and have written a lot of PowerShell scripts. Out of idle curiosity, and the need for a Friday Fun topic, I decided to see how many lines of PowerShell I have written. Or at least that are in my Scripts folder. Turns out I have...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-02-14T15:47:59+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler-150x150.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\/powershell\/3685\/friday-fun-the-measure-of-a-file\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: The Measure of a File","datePublished":"2014-02-14T15:47:59+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/"},"wordCount":396,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler-150x150.png","keywords":["Friday Fun","Measure-Object","PowerShell"],"articleSection":["Friday Fun","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/","name":"Friday Fun: The Measure of a File &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler-150x150.png","datePublished":"2014-02-14T15:47:59+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-file\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler.png","width":194,"height":159},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3685\/friday-fun-the-measure-of-a-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: The Measure of a 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":2330,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2330\/friday-fun-get-latest-powershell-scripts\/","url_meta":{"origin":3685,"position":0},"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":3715,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/3715\/friday-fun-the-measure-of-a-folder\/","url_meta":{"origin":3685,"position":1},"title":"Friday Fun: The Measure of a Folder","author":"Jeffery Hicks","date":"February 21, 2014","format":false,"excerpt":"Last week, I demonstrated how to measure a file with PowerShell. This week let's go a step further and measure a folder. I'm going to continue to use Measure-Object although this time I will need to use it to measure numeric property values. Here's the complete function after which I'll\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"ruler","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/ruler-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6996,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6996\/powershell-controller-scripts\/","url_meta":{"origin":3685,"position":2},"title":"PowerShell Controller Scripts","author":"Jeffery Hicks","date":"November 26, 2019","format":false,"excerpt":"When it comes to PowerShell scripting we tend to focus a lot on functions and modules. We place an emphasis on building re-usable tools. The idea is that we can then use these tools at a PowerShell prompt to achieve a given task. More than likely, these tasks are repetitive.\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\/2019\/11\/image_thumb-21.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4449,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4449\/measure-that-folder-with-powershell-revisited\/","url_meta":{"origin":3685,"position":3},"title":"Measure that Folder with PowerShell Revisited","author":"Jeffery Hicks","date":"July 15, 2015","format":false,"excerpt":"Last year I posted a PowerShell function to measure the size of a folder. I recently had a need to use it again, and realized it needed a few tweaks. By default, the original version recursively searched through all subfolders. But there may be situations where you only want to\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":4465,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4465\/measuring-folders-with-powershell-one-more-time\/","url_meta":{"origin":3685,"position":4},"title":"Measuring Folders with PowerShell One More Time","author":"Jeffery Hicks","date":"July 22, 2015","format":false,"excerpt":"I know I just posted an update to my Measure-Folder function but I couldn't help myself and now I have an update to the update. Part of the update came as the result of a comment asking about formatting results to a certain number of decimal places. I typically the\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":2639,"url":"https:\/\/jdhitsolutions.com\/blog\/friday-fun\/2639\/friday-fun-scraping-the-web-with-powershell-v3\/","url_meta":{"origin":3685,"position":5},"title":"Friday Fun: Scraping the Web with PowerShell v3","author":"Jeffery Hicks","date":"December 21, 2012","format":false,"excerpt":"We often think about PowerShell v3 as being a management tool for the cloud. One new PowerShell v3 cmdlet that lends substance to this idea is Invoke-WebRequest. This is a handy for retrieving data from a web site resource. It might be a public web site or something on your\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\/3685","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=3685"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3685\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}