{"id":1716,"date":"2011-10-25T09:09:31","date_gmt":"2011-10-25T13:09:31","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1716"},"modified":"2013-09-13T08:58:19","modified_gmt":"2013-09-13T12:58:19","slug":"convert-text-to-object","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/","title":{"rendered":"Convert Text to Object"},"content":{"rendered":"<p>Today I have another tool in my new battle regarding turning command line tools into PowerShell tools. The bottom line is we want to have objects written to the pipeline. At the PowerShell Deep Dive in Frankfurt there was a suggestion about providing tools to help with the transformation from CLI to PowerShell and this is one of the items I came up with.<\/p>\n<p>Many command line tools write output in a structured format. For example run this command:<\/p>\n<pre class=\"lang:batch decode:true\">C:\\&gt; tasklist \/fo list<\/pre>\n<p>There's an \"object\" staring at us for each task. As an aside, don't focus on the command line tool I'm using, pay attention to the technique. To turn output like this into ah object we simply need to split each line at the colon. The first index of the array will be the \"property\" name and the second index is the value. Here's the function I pulled together.<\/p>\n<pre class=\"lang:ps decode:true\">Function Convert-TextToObject {\r\n\r\n&lt;#\r\nThis function takes a collection of simple delimited lines and\r\nturns them into an object. The function assumes a single delimiter.\r\nThe default delimiter is the colon (:). The item to the left will be\r\nthe property and the item on the left will be the property value.\r\n\r\nUse $GroupCount to keep track of items that come in groups and write a new object\r\nwhen the count has been reached. For example, this allows you to pipe\r\nin a long collection of strings and turn every 5 into an object.\r\n\r\ntasklist \/s server01 \/fo list | where {$_} | convert-texttoobject -group 5\r\n#&gt;\r\n\r\n[cmdletbinding(SupportsShouldProcess=$True)]\r\n\r\nparam (\r\n[Parameter(Position=0,Mandatory=$True,HelpMessage=\"Enter a string to be parsed into an object\",\r\nValueFromPipeline=$True)]\r\n[ValidateNotNullorEmpty()]\r\n[string[]]$Text,\r\n[string]$Delimiter=\":\",\r\n[int]$GroupCount\r\n)\r\n\r\nBegin {\r\nWrite-Verbose \"Starting $($myinvocation.mycommand)\"\r\n#define a hashtable\r\n$myHash=@{}\r\nif ($GroupCount) {\r\nWrite-Verbose \"Grouping every $GroupCount items as an object\"\r\n}\r\n#start an internal counter\r\n$i=0\r\n}\r\n\r\nProcess {\r\n\r\nForeach ($item in $text) {\r\n\r\nif ($i -lt $GroupCount) {\r\n$i++\r\n}\r\nelse {\r\n#reset\r\n$i=1\r\n}\r\n\r\n#split each line at the delimiter\r\n$data=$item.Split($delimiter)\r\n#remove spaces from \"property\" name\r\n$prop=$data[0].Replace(\" \",\"\")\r\n\r\n#trim\r\n$prop=$prop.Trim()\r\n$val=$data[1].Trim()\r\n\r\n#add to hash table\r\nWrite-Verbose \"Adding $prop to hash table with a value of $val\"\r\n$myHash.Add($prop,$val)\r\n\r\n#if internal counter is equal to the group count\r\n#write the object and reset the hash table\r\nif ($i -eq $groupCount) {\r\nNew-Object -TypeName PSObject -Property $myHash\r\n$myHash.Clear()\r\n}\r\n\r\n} #foreach\r\n}\r\nEnd {\r\n#create new object from hash table\r\nif ($myHash.count -gt 0) {\r\nNew-Object -TypeName PSObject -Property $myHash\r\nWrite-Verbose \"Ending $($myinvocation.mycommand)\"\r\n}\r\n}\r\n\r\n} #end function<\/pre>\n<p>The function processes each incoming line of text and splits it on the delimiter. The default is the colon since many CLI tools seem to use it.<\/p>\n<pre class=\"lang:ps decode:true\">#split each line at the delimiter\r\n$data=$item.Split($delimiter)<\/pre>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">Since I prefer property names without spaces I remove them from index 0 of the array. I've also found it helpful to trim everything to eliminate extra white space.<\/span><\/p>\n<pre class=\"lang:ps decode:true\">#remove spaces from \"property\" name\r\n$prop=$data[0].Replace(\" \",\"\")\r\n\r\n#trim\r\n$prop=$prop.Trim()\r\n$val=$data[1].Trim()<\/pre>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">Each line is then added to a hash table.<\/span><\/p>\n<pre class=\"lang:ps decode:true\">#add to hash table\r\nWrite-Verbose \"Adding $prop to hash table with a value of $val\"\r\n$myHash.Add($prop,$val)<\/pre>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">When the hash table is complete it is used to create a new object.<\/span><\/p>\n<pre class=\"lang:ps decode:true\">New-Object -TypeName PSObject -Property $myHash<\/pre>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">The other \"trick\" I added is to group lines into an object. This let's me take say every 5 lines of text and make that a single object. I create a counter and increment it whenever a line is processed. When the counter meets the limit, the object is created, the hash table is cleared and the process repeats.<\/span><\/p>\n<pre class=\"lang:ps decode:true\">#if internal counter is equal to the group count\r\n#write the object and reset the hash table\r\nif ($i -eq $groupCount) {\r\nNew-Object -TypeName PSObject -Property $myHash\r\n$myHash.Clear()\r\n}<\/pre>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">Now I can run a command like this:<\/span><\/p>\n<pre class=\"lang:batch decode:true\">PS D:\\scripts&gt; tasklist \/fo list | where {$_} | Convert-TextToObject -group 5\r\n\r\nSession# : 0\r\nSessionName : Services\r\nPID : 0\r\nMemUsage : 24 K\r\nImageName : System Idle Process\r\n\r\nSession# : 0\r\nSessionName : Services\r\nPID : 4\r\nMemUsage : 96 K\r\nImageName : System\r\n\r\nSession# : 0\r\nSessionName : Services\r\nPID : 412\r\nMemUsage : 1,164 K\r\nImageName : smss.exe\r\n...<\/pre>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">The output looks similar but now I have objects so I can take advantage of PowerShell. Here are some examples:<\/span><\/p>\n<pre class=\"lang:ps decode:true\">tasklist \/fo list | where {$_} | Convert-TextToObject -group 5 | ft -auto\r\ntasklist \/fo list | where {$_} | Convert-TextToObject -group 5 | group SessionName\r\ntasklist \/s $computer \/fo list | where {$_} | Convert-TextToObject -GroupCount 5 | Add-member not\r\neproperty Computername $computer -pass | Export-CSV taskreport.csv<\/pre>\n<p>This is by no means perfect but I'd like to think it is a good start. For example, one downside is that all properties are strings where it would be nicer to have properties of an appropriate type. Still, I hope you'll try this out and let me know what you think.<\/p>\n<p>Download <a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/Convert-TexttoObject.txt\" target=\"_blank\">Convert-TexttoObject<\/a><\/p>\n<p><strong>Update<\/strong><br \/>\nA newer version of the script can be found at <a href=\"http:\/\/jdhitsolutions.com\/blog\/2012\/01\/convert-text-to-object-updated\/\" target=\"_blank\">http:\/\/jdhitsolutions.com\/blog\/2012\/01\/convert-text-to-object-updated\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I have another tool in my new battle regarding turning command line tools into PowerShell tools. The bottom line is we want to have objects written to the pipeline. At the PowerShell Deep Dive in Frankfurt there was a suggestion about providing tools to help with the transformation from CLI to PowerShell and this&#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":[72,134,4],"tags":[281,32,199,190,144,534,540],"class_list":["post-1716","post","type-post","status-publish","format-standard","hentry","category-commandline","category-conferences","category-powershell","tag-deepdive","tag-functions","tag-hashtable","tag-new-object","tag-objects","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Convert Text to Object &#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\/1716\/convert-text-to-object\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Convert Text to Object &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Today I have another tool in my new battle regarding turning command line tools into PowerShell tools. The bottom line is we want to have objects written to the pipeline. At the PowerShell Deep Dive in Frankfurt there was a suggestion about providing tools to help with the transformation from CLI to PowerShell and this...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-25T13:09:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-09-13T12:58:19+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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Convert Text to Object\",\"datePublished\":\"2011-10-25T13:09:31+00:00\",\"dateModified\":\"2013-09-13T12:58:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/\"},\"wordCount\":393,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"DeepDive\",\"functions\",\"hashtable\",\"new-object\",\"objects\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"CommandLine\",\"Conferences\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/\",\"name\":\"Convert Text to Object &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-10-25T13:09:31+00:00\",\"dateModified\":\"2013-09-13T12:58:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1716\\\/convert-text-to-object\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CommandLine\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/commandline\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert Text to Object\"}]},{\"@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":"Convert Text to Object &#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\/1716\/convert-text-to-object\/","og_locale":"en_US","og_type":"article","og_title":"Convert Text to Object &#8226; The Lonely Administrator","og_description":"Today I have another tool in my new battle regarding turning command line tools into PowerShell tools. The bottom line is we want to have objects written to the pipeline. At the PowerShell Deep Dive in Frankfurt there was a suggestion about providing tools to help with the transformation from CLI to PowerShell and this...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-10-25T13:09:31+00:00","article_modified_time":"2013-09-13T12:58:19+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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Convert Text to Object","datePublished":"2011-10-25T13:09:31+00:00","dateModified":"2013-09-13T12:58:19+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/"},"wordCount":393,"commentCount":9,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["DeepDive","functions","hashtable","new-object","objects","PowerShell","Scripting"],"articleSection":["CommandLine","Conferences","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/","name":"Convert Text to Object &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-10-25T13:09:31+00:00","dateModified":"2013-09-13T12:58:19+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1716\/convert-text-to-object\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"CommandLine","item":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},{"@type":"ListItem","position":2,"name":"Convert Text to Object"}]},{"@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":1757,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1757\/turning-ipconfig-dnscache-into-powershell\/","url_meta":{"origin":1716,"position":0},"title":"Turning IPConfig DNSCache into PowerShell","author":"Jeffery Hicks","date":"November 14, 2011","format":false,"excerpt":"Lately I've been writing about techniques to turn command line tools into PowerShell tools. Although I suppose the more accurate description is turning command line output into PowerShell pipelined output. The goal is to run a command line tool and write objects to the PowerShell pipeline so I can do\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/11\/displaydns-300x168.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6855,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-7\/6855\/powershell-scripting-for-linux-is-still-about-the-objects\/","url_meta":{"origin":1716,"position":1},"title":"PowerShell Scripting for Linux is Still About the Objects","author":"Jeffery Hicks","date":"October 8, 2019","format":false,"excerpt":"I've been trying to increase my Linux skills, especially as I begin to write PowerShell scripts and tools that can work cross-platform. One very important concept I want to make sure you don't overlook is that even when scripting for non-Windows platforms, you must still be thinking about objects. The\u2026","rel":"","context":"In &quot;PowerShell 7&quot;","block_context":{"text":"PowerShell 7","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-7\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1708,"url":"https:\/\/jdhitsolutions.com\/blog\/commandline\/1708\/turning-cli-tools-into-powershell-tools-deep-dive-demos\/","url_meta":{"origin":1716,"position":2},"title":"Turning CLI Tools into PowerShell Tools Deep Dive Demos","author":"Jeffery Hicks","date":"October 24, 2011","format":false,"excerpt":"Last week I did a presentation at the PowerShell Deep Dive in Frankfurt about turning command line tools into PowerShell tools. A video recording should be posted later. But in the meantime, here is a copy of my slide deck, in PDF and a zip file with my demos and\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/nbtstat-n-300x158.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3757,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3757\/convert-a-string-to-a-powershell-property-name\/","url_meta":{"origin":1716,"position":3},"title":"Convert a String to a PowerShell Property Name","author":"Jeffery Hicks","date":"March 25, 2014","format":false,"excerpt":"Over the last few years I've written and presented a bit on the idea of turning command line tools into PowerShell tools. We have a lot of great CLI based tools that are still worth using. What I've done is come up with tools and techniques for turning their output\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"talkbubble","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1636,"url":"https:\/\/jdhitsolutions.com\/blog\/conferences\/1636\/powershell-deep-dive-europe\/","url_meta":{"origin":1716,"position":4},"title":"PowerShell Deep Dive Europe","author":"Jeffery Hicks","date":"August 29, 2011","format":false,"excerpt":"I'm happy to report that I will be presenting a session at the PowerShell Deep Dive in Frankfurt this October as part of The Experts Conference. The conference in Las Vegas this past April was amazing, intense and the most fun I think I've ever had. If you can make\u2026","rel":"","context":"In &quot;Conferences&quot;","block_context":{"text":"Conferences","link":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6492,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6492\/creating-more-git-powershell-tools\/","url_meta":{"origin":1716,"position":5},"title":"Creating More Git PowerShell Tools","author":"Jeffery Hicks","date":"February 1, 2019","format":false,"excerpt":"I have received a tremendous amount of interest in my recent articles on creating a git sizing tool using PowerShell. Many of you were savvy enough to realize the journey I was describing was just as important as the destination. With that in mind, I decided to revisit another PowerShell\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\/02\/image_thumb-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1716","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=1716"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1716\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}