{"id":2009,"date":"2012-01-19T09:21:50","date_gmt":"2012-01-19T14:21:50","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2009"},"modified":"2012-01-19T09:21:50","modified_gmt":"2012-01-19T14:21:50","slug":"using-types-with-imported-csv-data-in-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/","title":{"rendered":"Using Types with Imported CSV Data in PowerShell"},"content":{"rendered":"<p>The Import-CSV cmdlet in PowerShell is incredibly useful. You can take any CSV file and pump objects to the pipeline. The cmdlet uses the CSV header as properties for the custom object.<\/p>\n<p><code><br \/>\nPS S:\\> import-csv .\\testdata.csv<\/p>\n<p>Date    : 1\/18\/2012 6:45:30 AM<br \/>\nName    : Data_1<br \/>\nService : ALG<br \/>\nKey     : 1<br \/>\nSize    : 25<\/p>\n<p>Date    : 1\/18\/2012 2:17:30 AM<br \/>\nName    : Data_2<br \/>\nService : AppIDSvc<br \/>\nKey     : 2<br \/>\nSize    : -30<br \/>\n...<br \/>\n<\/code><\/p>\n<p>But there is a downside: all of the properties are strings.<\/p>\n<p><code><br \/>\nPS S:\\> import-csv .\\testdata.csv | get-member<\/p>\n<p>   TypeName: System.Management.Automation.PSCustomObject<\/p>\n<p>Name        MemberType   Definition<br \/>\n----        ----------   ----------<br \/>\nEquals      Method       bool Equals(System.Object obj)<br \/>\nGetHashCode Method       int GetHashCode()<br \/>\nGetType     Method       type GetType()<br \/>\nToString    Method       string ToString()<br \/>\nDate        NoteProperty System.String Date=1\/18\/2012 6:45:30 AM<br \/>\nKey         NoteProperty System.String Key=1<br \/>\nName        NoteProperty System.String Name=Data_1<br \/>\nService     NoteProperty System.String Service=ALG<br \/>\nSize        NoteProperty System.String Size=25<br \/>\n<\/code><\/p>\n<p>The means some tasks such sorting or filtering will fail. But there are ways to get around this limitation. One way is to use an expression to cast a property to a different type. For example, I want to sort my test data on the Date property, but it needs to be a [DateTime] object to sort properly. Here's how:<\/p>\n<p><code><br \/>\nPS S:\\> import-csv testdata.csv  | sort @{expression={$_.date -as [datetime]}} | Select Date,Name,Size<\/p>\n<p>Date                       Name                       Size<br \/>\n----                       ----                       ----<br \/>\n1\/9\/2012 6:28:30 PM        Data_25                    26<br \/>\n1\/11\/2012 11:13:30 AM      Data_20                    44<br \/>\n1\/11\/2012 6:28:30 PM       Data_23                    33<br \/>\n1\/13\/2012 12:13:30 AM      Data_16                    42<br \/>\n1\/13\/2012 4:45:30 PM       Data_24                    47<br \/>\n...<br \/>\n<\/code><\/p>\n<p>My output object properties are all still strings. All I did was cast the Date property in the Sort expression. Here's an example using filtering.<\/p>\n<p><code><br \/>\nPS S:\\> import-csv testdata.csv  | where {($_.date -as [datetime]) -le (\"1\/12\/2012\" -as [datetime])} | Select Date,Name,Size<\/p>\n<p>Date                       Name                       Size<br \/>\n----                       ----                       ----<br \/>\n1\/11\/2012 11:13:30 AM      Data_20                    44<br \/>\n1\/11\/2012 6:28:30 PM       Data_23                    33<br \/>\n1\/9\/2012 6:28:30 PM        Data_25                    26<br \/>\n<\/code><\/p>\n<p>These examples are only producing results. More likely I want to import the CSV file as typed objects.  Assuming you know in advance the property names and what types you want to use, here's how you could achieve this.<\/p>\n<p><code><br \/>\nPS S:\\> $data=import-csv testdata.csv | Select @{Name=\"Date\";Expression={[datetime]$_.Date}}, Name,Service,@{Name=\"Key\";Expression={[int32]$_.Key}},@{Name=\"Size\";Expression={[int32]$_.Size}}<br \/>\n<\/code><\/p>\n<p>I imported my CSV file and piped it to Select-Object, using hash tables to redefine the properties with appropriate types. Import-CSV writes a PSCustomObject to the pipeline anyway so using Select-Object has no effect other than giving me typed properties.<\/p>\n<p><code><br \/>\nPS S:\\> $data | get-member<\/p>\n<p>   TypeName: Selected.System.Management.Automation.PSCustomObject<\/p>\n<p>Name        MemberType   Definition<br \/>\n----        ----------   ----------<br \/>\nEquals      Method       bool Equals(System.Object obj)<br \/>\nGetHashCode Method       int GetHashCode()<br \/>\nGetType     Method       type GetType()<br \/>\nToString    Method       string ToString()<br \/>\nDate        NoteProperty System.DateTime Date=1\/18\/2012 6:45:30 AM<br \/>\nKey         NoteProperty System.Int32 Key=1<br \/>\nName        NoteProperty System.String Name=Data_1<br \/>\nService     NoteProperty System.String Service=ALG<br \/>\nSize        NoteProperty System.Int32 Size=25<br \/>\n<\/code><\/p>\n<p>Now I can use $data objects anyway I want. <\/p>\n<p><code><br \/>\nPS S:\\> $data | where {$_.size -ge 40 -AND $_.key -le 10}<\/p>\n<p>Date    : 1\/17\/2012 11:57:30 PM<br \/>\nName    : Data_3<br \/>\nService : Appinfo<br \/>\nKey     : 3<br \/>\nSize    : 42<br \/>\n<\/code><\/p>\n<p>I'm working on something that takes this idea to the next level but it isn't quite ready for prime time. But I hope this will help manage imported objects a bit more efficiently and let you really take advantage of the PowerShell pipeline.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Import-CSV cmdlet in PowerShell is incredibly useful. You can take any CSV file and pump objects to the pipeline. The cmdlet uses the CSV header as properties for the custom object. PS S:\\> import-csv .\\testdata.csv Date : 1\/18\/2012 6:45:30 AM Name : Data_1 Service : ALG Key : 1 Size : 25 Date :&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[75,8],"tags":[356,144,534,540,357,301],"class_list":["post-2009","post","type-post","status-publish","format-standard","hentry","category-powershell-v2-0","category-scripting","tag-import-csv","tag-objects","tag-powershell","tag-scripting","tag-sort","tag-where-object"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using Types with Imported CSV Data in PowerShell &#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\/2009\/using-types-with-imported-csv-data-in-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Types with Imported CSV Data in PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"The Import-CSV cmdlet in PowerShell is incredibly useful. You can take any CSV file and pump objects to the pipeline. The cmdlet uses the CSV header as properties for the custom object. PS S:&gt; import-csv .testdata.csv Date : 1\/18\/2012 6:45:30 AM Name : Data_1 Service : ALG Key : 1 Size : 25 Date :...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-19T14:21:50+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Using Types with Imported CSV Data in PowerShell\",\"datePublished\":\"2012-01-19T14:21:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/\"},\"wordCount\":272,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Import-CSV\",\"objects\",\"PowerShell\",\"Scripting\",\"Sort\",\"Where-Object\"],\"articleSection\":[\"PowerShell v2.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/\",\"name\":\"Using Types with Imported CSV Data in PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2012-01-19T14:21:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/2009\\\/using-types-with-imported-csv-data-in-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell v2.0\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell-v2-0\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Types with Imported CSV Data in PowerShell\"}]},{\"@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":"Using Types with Imported CSV Data in PowerShell &#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\/2009\/using-types-with-imported-csv-data-in-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Using Types with Imported CSV Data in PowerShell &#8226; The Lonely Administrator","og_description":"The Import-CSV cmdlet in PowerShell is incredibly useful. You can take any CSV file and pump objects to the pipeline. The cmdlet uses the CSV header as properties for the custom object. PS S:> import-csv .testdata.csv Date : 1\/18\/2012 6:45:30 AM Name : Data_1 Service : ALG Key : 1 Size : 25 Date :...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2012-01-19T14:21:50+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Using Types with Imported CSV Data in PowerShell","datePublished":"2012-01-19T14:21:50+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/"},"wordCount":272,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Import-CSV","objects","PowerShell","Scripting","Sort","Where-Object"],"articleSection":["PowerShell v2.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/","name":"Using Types with Imported CSV Data in PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2012-01-19T14:21:50+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell v2.0","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},{"@type":"ListItem","position":2,"name":"Using Types with Imported CSV Data in PowerShell"}]},{"@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":531,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/531\/think-objectively\/","url_meta":{"origin":2009,"position":0},"title":"Think Objectively","author":"Jeffery Hicks","date":"December 14, 2009","format":false,"excerpt":"A challenge many new comers to PowerShell face, especially those arriving with a VBScript background, and one that I often talk about, is shifting gears from working with text to working with objects. Here\u2019s a good example. The Win32_OperatingSystem class returns a value for TotalVisibleMemorySize, which should be the amount\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":2148,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/","url_meta":{"origin":2009,"position":1},"title":"Get Cmdlet Help URL","author":"Jeffery Hicks","date":"April 2, 2012","format":false,"excerpt":"I was toying around with PowerShell help this morning and as usually happens one thing leads to another. When you run Get-Help, or use the wrapper function Help, you are actually getting an object: MamlCommandHelpInfo. This object has properties that you are use to seeing like name and synopsis. PS\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":2062,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2062\/export-and-import-hash-tables\/","url_meta":{"origin":2009,"position":2},"title":"Export and Import Hash Tables","author":"Jeffery Hicks","date":"February 2, 2012","format":false,"excerpt":"I use hash tables quite a bit and with the impending arrival of PowerShell 3.0 I expect even more so. PowerShell v3 allows you to define a hash table of default parameter values. I'm not going to to cover that feature specifically, but it made me realize I needed a\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":8409,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8409\/custom-csv-import-with-powershell\/","url_meta":{"origin":2009,"position":3},"title":"Custom CSV Import with PowerShell","author":"Jeffery Hicks","date":"May 18, 2021","format":false,"excerpt":"I am always looking for opportunities to use PowerShell in a way that adds value to my work. And hopefully yours. This is one of the reasons it is worth the time and effort to learn PowerShell. It can be used in so many ways beyond the out-of-the-box commands. Once\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\/05\/importcsv-customtype.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/importcsv-customtype.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/importcsv-customtype.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/importcsv-customtype.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1136,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1136\/friday-fun-snappy-shortcuts\/","url_meta":{"origin":2009,"position":4},"title":"Friday Fun &#8211; Snappy Shortcuts","author":"Jeffery Hicks","date":"February 11, 2011","format":false,"excerpt":"In one of my recent Prof. PowerShell columns, I wrote about using the Wscript.Shell VBScript object in PowerShell to retrieve special folder paths. Another handy trick is the ability to create shortcut links to either file or web resources. Let me show you how to accomplish this in PowerShell and\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\/2011\/02\/create-shortcuts-300x185.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4039,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4039\/sorting-hash-tables\/","url_meta":{"origin":2009,"position":5},"title":"Sorting Hash Tables","author":"Jeffery Hicks","date":"September 22, 2014","format":false,"excerpt":"Over the weekend I received a nice comment from a reader who came across an old post of mine on turning an object into a hash table.\u00a0 He wanted to add a comment but my blog closes comments after a period of time. But I thought it was worth sharing,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"letterjumble","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/03\/letterjumble-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2009","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=2009"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2009\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}