{"id":3893,"date":"2014-06-25T10:51:44","date_gmt":"2014-06-25T14:51:44","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3893"},"modified":"2014-06-25T12:20:36","modified_gmt":"2014-06-25T16:20:36","slug":"more-powershell-laziness","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/","title":{"rendered":"More PowerShell Laziness"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-3894\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.png\" alt=\"lightbulb-idea\" width=\"201\" height=\"181\" \/><\/a>A few days ago I posted an <a title=\"PowerShell for the Lazy IT Pro\" href=\"http:\/\/jdhitsolutions.com\/blog\/2014\/06\/powershell-for-the-lazy-it-pro\/\" target=\"_blank\">article <\/a>on using Update-TypeData to provide shortcuts to object properties. These shortcuts might save a few keystrokes typing, especially if you use tab completion. They can also give you more meaningful output. But you can take this even further and save yourself even more typing. How many of you have struggled to type an expression like this:<\/p>\n<pre class=\"lang:ps decode:true\">dir c:\\work\\ -file  | where {$_.length -gt 100KB} | Select Name,\r\n@{Name=\"Modified\";Expression={$_.lastWritetime}},\r\n@{Name=\"SizeKB\";Expression={[math]::Round($_.length\/1KB,2)}} |\r\nSort SizeKB -Descending\r\n<\/pre>\n<p>If you read the last article, you already know that I can use my alias property shortcuts. But you can also define other types of properties. Let's say I often want to get file sizes in KB, and it is pretty tedious having to use Select-Object all the time with a custom hashtable. Instead I can do this with Update-TypeData:<\/p>\n<pre class=\"lang:ps decode:true\">Update-TypeData -TypeName System.IO.FileInfo -MemberType ScriptProperty -MemberName SizeKB -Value {[math]::Round($this.length\/1KB,2)} \r\n<\/pre>\n<p>When defining a ScriptProperty, the $this variable is used instead of $_. Using my previously created aliases, my command is now much easier to write:<\/p>\n<pre class=\"lang:batch decode:true\">PS C:\\&gt; dir c:\\work\\ -file  | where {$_.sz -gt 100KB} | Sort SizeKB -Descending | format-table Name,\r\nModified,SizeKB -AutoSize\r\n\r\nName                      Modified                 SizeKB\r\n----                      --------                 ------\r\nWeeklyProcs.xml           12\/27\/2013 12:39:52 PM 16660.45\r\nSSCERuntime_x64-ENU.msi   2\/11\/2010 8:36:32 PM     3567.5\r\nSSCERuntime_x86-ENU.msi   2\/11\/2010 8:36:18 PM       3090\r\ntest.exe                  1\/14\/2014 10:43:15 AM    540.54\r\npsight.csv                3\/4\/2014 10:12:46 AM     508.31\r\nWMIExplorer.exe           5\/21\/2012 1:32:15 PM        452\r\ntest2.exe                 5\/4\/1999 4:33:24 PM      270.27\r\ntest2.ext                 5\/4\/1999 4:33:24 PM      270.27\r\nPS4NewFeatures-m3.camproj 3\/29\/2014 7:13:43 PM     255.65\r\ndu.exe                    5\/29\/2014 11:42:40 AM    218.19\r\nchi-hvr2-health-full.htm  1\/23\/2014 10:01:27 AM    127.96\r\nwindowtime.xml            6\/16\/2014 1:32:03 PM     102.17\r\n<\/pre>\n<p>With the aliases I can use them anywhere in a PowerShell expression. Let me leave you with one more example:<\/p>\n<pre class=\"lang:ps decode:true\">Update-TypeData -TypeName Microsoft.PowerShell.Commands.GenericMeasureInfo -MemberType ScriptProperty -MemberName SumKB -Value {[math]::Round($this.sum\/1KB,2)} -Force\r\nUpdate-TypeData -TypeName Microsoft.PowerShell.Commands.GenericMeasureInfo -MemberType ScriptProperty -MemberName SumMB -Value {[math]::Round($this.sum\/1MB,2)} -Force\r\nUpdate-TypeData -TypeName Microsoft.PowerShell.Commands.GenericMeasureInfo -MemberType ScriptProperty -MemberName SumGB -Value {[math]::Round($this.sum\/1GB,2)} -Force\r\n<\/pre>\n<p>I often need to get the total value of something, but often I need it in a different format such as MB or GB. Now I have it.<\/p>\n<pre class=\"lang:batch decode:true\">PS C:\\&gt; dir c:\\work\\*.xml | where {$_.sz -gt 1kb} | measure -Property Size -Sum\r\n\r\n\r\nCount    : 7\r\nAverage  :\r\nSum      : 17199422\r\nMaximum  :\r\nMinimum  :\r\nProperty : Size\r\nSumKB    : 16796.31\r\nSumMB    : 16.4\r\nSumGB    : 0.02\r\n\r\nPS C:\\&gt; (ps chrome | measure ws -sum).SumGB\r\n1.23<\/pre>\n<p>That definitely saves some typing. I should probably do something similar for Maximum and Minimum properties as well.<\/p>\n<p>So, what are you constantly typing? Is it something you could be smarter about? I hope you'll share so I can take advantage of your laziness, I mean, efficiency!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few days ago I posted an article on using Update-TypeData to provide shortcuts to object properties. These shortcuts might save a few keystrokes typing, especially if you use tab completion. They can also give you more meaningful output. But you can take this even further and save yourself even more typing. How many of&#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":"More #PowerShell Laziness http:\/\/bit.ly\/1l3y9G6","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":[4,359,450,8],"tags":[466,534,439],"class_list":["post-3893","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-3-0","category-powershell-4-0","category-scripting","tag-aliases","tag-powershell","tag-update-typedata"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>More PowerShell Laziness &#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\/3893\/more-powershell-laziness\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More PowerShell Laziness &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"A few days ago I posted an article on using Update-TypeData to provide shortcuts to object properties. These shortcuts might save a few keystrokes typing, especially if you use tab completion. They can also give you more meaningful output. But you can take this even further and save yourself even more typing. How many of...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-25T14:51:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-06-25T16:20:36+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"More PowerShell Laziness\",\"datePublished\":\"2014-06-25T14:51:44+00:00\",\"dateModified\":\"2014-06-25T16:20:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/\"},\"wordCount\":248,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/lightbulb-idea.png\",\"keywords\":[\"Aliases\",\"PowerShell\",\"Update-TypeData\"],\"articleSection\":[\"PowerShell\",\"Powershell 3.0\",\"PowerShell 4.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/\",\"name\":\"More PowerShell Laziness &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/lightbulb-idea.png\",\"datePublished\":\"2014-06-25T14:51:44+00:00\",\"dateModified\":\"2014-06-25T16:20:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/lightbulb-idea.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/06\\\/lightbulb-idea.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3893\\\/more-powershell-laziness\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"More PowerShell Laziness\"}]},{\"@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":"More PowerShell Laziness &#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\/3893\/more-powershell-laziness\/","og_locale":"en_US","og_type":"article","og_title":"More PowerShell Laziness &#8226; The Lonely Administrator","og_description":"A few days ago I posted an article on using Update-TypeData to provide shortcuts to object properties. These shortcuts might save a few keystrokes typing, especially if you use tab completion. They can also give you more meaningful output. But you can take this even further and save yourself even more typing. How many of...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-06-25T14:51:44+00:00","article_modified_time":"2014-06-25T16:20:36+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"More PowerShell Laziness","datePublished":"2014-06-25T14:51:44+00:00","dateModified":"2014-06-25T16:20:36+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/"},"wordCount":248,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.png","keywords":["Aliases","PowerShell","Update-TypeData"],"articleSection":["PowerShell","Powershell 3.0","PowerShell 4.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/","name":"More PowerShell Laziness &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.png","datePublished":"2014-06-25T14:51:44+00:00","dateModified":"2014-06-25T16:20:36+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/lightbulb-idea.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3893\/more-powershell-laziness\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"More PowerShell Laziness"}]},{"@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":5716,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5716\/adding-efficiency-with-powershell-type-extensions\/","url_meta":{"origin":3893,"position":0},"title":"Adding Efficiency with PowerShell Type Extensions","author":"Jeffery Hicks","date":"October 31, 2017","format":false,"excerpt":"The other day I posted an article about custom properties which wrapped up with a look at Update-TypeData. The goal is not so much to make your scripts or modules easier to use, but rather to increase efficiency at the command prompt. When running commands interactively I want to get\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-9.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-9.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-9.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-9.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3888,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3888\/powershell-for-the-lazy-it-pro\/","url_meta":{"origin":3893,"position":1},"title":"PowerShell for the Lazy IT Pro","author":"Jeffery Hicks","date":"June 23, 2014","format":false,"excerpt":"PowerShell is a great enabler for those of us who don't like to work any harder than we have to. Well, maybe I should say, \"for those of us who like to work more efficiently.\" PowerShell already comes loaded with a number of shortcuts and tricks for getting more done\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"hammock","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/06\/hammock.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6478,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6478\/powershell-scripting-getting-git-size-retooled\/","url_meta":{"origin":3893,"position":2},"title":"Getting Git Size with PowerShell Retooled","author":"Jeffery Hicks","date":"January 30, 2019","format":false,"excerpt":"A few days ago I wrote about my experiences in designing a PowerShell function that reports on the size of the hidden .git folder. In that version of the function I decided to include a parameter that would permit the user to get the size pre-formatted as either KB, MB\u2026","rel":"","context":"In &quot;Git&quot;","block_context":{"text":"Git","link":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-29.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-29.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-29.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-29.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":5702,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5702\/are-you-my-type\/","url_meta":{"origin":3893,"position":3},"title":"Are You My Type?","author":"Jeffery Hicks","date":"October 26, 2017","format":false,"excerpt":"I am always stressing that PowerShell is all about the objects. If you keep this in mind, PowerShell is pretty easy to use. Get a bunch of things, and select the details that you want to see or work with. Out of the box PowerShell gives you some very rich\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/10\/image_thumb-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1814,"url":"https:\/\/jdhitsolutions.com\/blog\/google-plus\/1814\/re-use-powershell-scriptblocks-i-commented\/","url_meta":{"origin":3893,"position":4},"title":"Re-Use PowerShell Scriptblocks","author":"Jeffery Hicks","date":"October 24, 2011","format":false,"excerpt":"\/\/Re-Use PowerShell Scriptblocks\/\/I commented on a blog post today that showed how to use a hash table with Select-Object to format file sizes say as KB.dir $env:temp -rec | select fullname,@{Name=\"KB\";Expression={$_.length\/1kb}}Since you most likely will want to use something similar for other directories, don't feel you have to re-invent the\u2026","rel":"","context":"In &quot;Google Plus&quot;","block_context":{"text":"Google Plus","link":"https:\/\/jdhitsolutions.com\/blog\/category\/google-plus\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8215,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8215\/powershell-property-sets-to-the-rescue\/","url_meta":{"origin":3893,"position":5},"title":"PowerShell Property Sets to the Rescue","author":"Jeffery Hicks","date":"March 11, 2021","format":false,"excerpt":"if you are like me and spend most of your day at a PowerShell prompt, anything that simplifies that process is worth the time to learn or set up. Even though I am a decent typist, I am more than happy to find ways to type less at a PowerShell\u2026","rel":"","context":"In &quot;GitHub&quot;","block_context":{"text":"GitHub","link":"https:\/\/jdhitsolutions.com\/blog\/category\/github\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/file-typeextensions2.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3893","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=3893"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3893\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}