{"id":3627,"date":"2016-08-01T18:48:27","date_gmt":"2016-08-01T23:48:27","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=3627"},"modified":"2016-08-01T18:48:27","modified_gmt":"2016-08-01T23:48:27","slug":"powershell-for-nix-people","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2016\/08\/01\/powershell-for-nix-people\/","title":{"rendered":"PowerShell for *nix people"},"content":{"rendered":"<p>PowerShell is becoming (has become) the replacement for VBScript on Microsoft operating systems.  It is a fairly robust scripting language that I think most administrators will be  happy to see.<\/p>\n<p>If you have a supported Microsoft operating system (i.e., not Windows XP) at your disposal, you will find it is already installed.<\/p>\n<p>Below is a simple example to get you started.  This simply finds all files in a given directory tree and prints the name.<\/p>\n<pre lang=\"text\">\r\nPS C:\\Users\\showard> Get-ChildItem C:\\users\\showard\\downloads *.txt -recurse | Foreach-Object {echo $_.FullName}\r\nC:\\users\\showard\\downloads\\20131015_cmh.txt\r\nC:\\users\\showard\\downloads\\20131016_cmh.txt\r\nC:\\users\\showard\\downloads\\20131017_cmh.txt\r\nC:\\users\\showard\\downloads\\20131018_cmh.txt\r\n\r\n<snip>\r\n\r\nC:\\users\\showard\\downloads\\second_hang.txt\r\nPS C:\\Users\\showard> $_.FullName\r\n<\/pre>\n<p>The example below will get registered network information for a given URL&#8230;<\/p>\n<pre lang=\"text\">\r\nPS C:\\Users\\showard> for ($i = 1; $i -le 4; $i++)\r\n>> {[System.Net.Dns]::GetHostAddresses(\"cmh-dev$i-www.express.com\")}\r\n>>\r\n\r\n\r\nAddress           : 819007584\r\nAddressFamily     : InterNetwork\r\nScopeId           :\r\nIsIPv6Multicast   : False\r\nIsIPv6LinkLocal   : False\r\nIsIPv6SiteLocal   : False\r\nIPAddressToString : 96.16.209.48\r\n\r\nAddress           : 819007584\r\nAddressFamily     : InterNetwork\r\nScopeId           :\r\nIsIPv6Multicast   : False\r\nIsIPv6LinkLocal   : False\r\nIsIPv6SiteLocal   : False\r\nIPAddressToString : 96.16.209.48\r\n\r\nAddress           : 819007584\r\nAddressFamily     : InterNetwork\r\nScopeId           :\r\nIsIPv6Multicast   : False\r\nIsIPv6LinkLocal   : False\r\nIsIPv6SiteLocal   : False\r\nIPAddressToString : 96.16.209.48\r\n\r\nAddress           : 819007584\r\nAddressFamily     : InterNetwork\r\nScopeId           :\r\nIsIPv6Multicast   : False\r\nIsIPv6LinkLocal   : False\r\nIsIPv6SiteLocal   : False\r\nIPAddressToString : 96.16.209.48\r\n\r\n\r\n\r\nPS C:\\Users\\showard>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell is becoming (has become) the replacement for VBScript on Microsoft operating systems. It is a fairly robust scripting language that I think most administrators will be happy to see. If you have a supported Microsoft operating system (i.e., not&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2016\/08\/01\/powershell-for-nix-people\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[28,27,55,30],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3627"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3627"}],"version-history":[{"count":4,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3627\/revisions"}],"predecessor-version":[{"id":5484,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/3627\/revisions\/5484"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3627"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}