{"id":79,"date":"2019-10-29T22:58:40","date_gmt":"2019-10-29T21:58:40","guid":{"rendered":"http:\/\/sys-code-alpha.com\/?p=79"},"modified":"2019-10-29T22:58:40","modified_gmt":"2019-10-29T21:58:40","slug":"easy-way-to-split-strings-with-powershell","status":"publish","type":"post","link":"https:\/\/sys-code-alpha.com\/?p=79","title":{"rendered":"Easy way to split strings with PowerShell"},"content":{"rendered":"\n<p>I was asked about an easy way to split strings with PowerShell. The way that would allow to define the amount of characters of the newly generated strings.  After a while I have prepared the following filter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>filter Split-String{ \n        Param([int]$CharCount = 2)\n        PROCESS{ $_ -split \"(?&lt;=\\G.{$CharCount})\" }\n}<\/code><\/pre>\n\n\n\n<p>The outcome is as follows:<\/p>\n\n\n\n<p>C:\\> &#8220;whatever&#8221; | Split-String -CharCount 3<br> wha<br> tev<br> er<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was asked about an easy way to split strings with PowerShell. The way that would allow to define the amount of characters of the newly generated strings. After a while I have prepared the following filter: The outcome is as follows: C:\\> &#8220;whatever&#8221; | Split-String -CharCount 3 wha tev er<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts\/79"}],"collection":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79"}],"version-history":[{"count":1,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sys-code-alpha.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}