{"id":522,"date":"2020-02-13T14:49:06","date_gmt":"2020-02-13T14:49:06","guid":{"rendered":"https:\/\/pruszewicz.com\/wordpress\/?p=522"},"modified":"2020-03-12T09:31:21","modified_gmt":"2020-03-12T08:31:21","slug":"display-some-lines-before-and-after-matched-pattern-using-pipe-to-powershell","status":"publish","type":"post","link":"http:\/\/pruszewicz.com\/wordpress\/display-some-lines-before-and-after-matched-pattern-using-pipe-to-powershell\/","title":{"rendered":"display some lines before and after matched pattern, using pipe to powershell"},"content":{"rendered":"<pre><code>C:\\Users\\Administrator>ping tool.eu.org\r\n\r\nC:\\Users\\Administrator>ipconfig \/displaydns |powershell -Command \"$input |Out-String -stream |Select-String -pattern ': tool' -Context 2,4\"\r\n\r\n       tool.eu.org\r\n       ----------------------------------------\r\n>      Record Name . . . . . : tool.eu.org\r\n       Record Type . . . . . : 1\r\n       Time To Live  . . . . : 1476\r\n       Data Length . . . . . : 4\r\n       Section . . . . . . . : Answer<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>C:\\Users\\Administrator>ping tool.eu.org C:\\Users\\Administrator>ipconfig \/displaydns |powershell -Command &#8220;$input |Out-String -stream |Select-String -pattern &#8216;: tool&#8217; -Context 2,4&#8221; tool.eu.org &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- > Record Name . . . . . : tool.eu.org Record Type . . . . . : 1 Time To Live . &hellip; <a href=\"http:\/\/pruszewicz.com\/wordpress\/display-some-lines-before-and-after-matched-pattern-using-pipe-to-powershell\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-522","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/posts\/522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/comments?post=522"}],"version-history":[{"count":4,"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/posts\/522\/revisions"}],"predecessor-version":[{"id":536,"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/posts\/522\/revisions\/536"}],"wp:attachment":[{"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/media?parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/categories?post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pruszewicz.com\/wordpress\/wp-json\/wp\/v2\/tags?post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}