{"id":665,"date":"2011-09-04T20:12:38","date_gmt":"2011-09-05T00:12:38","guid":{"rendered":"http:\/\/enterpriseadmins.org\/blog\/?p=665"},"modified":"2011-09-04T20:12:38","modified_gmt":"2011-09-05T00:12:38","slug":"powercli-vcheck-and-powershell-1-0-support","status":"publish","type":"post","link":"https:\/\/enterpriseadmins.org\/blog\/scripting\/powercli-vcheck-and-powershell-1-0-support\/","title":{"rendered":"PowerCLI vCheck and PowerShell 1.0 support"},"content":{"rendered":"<p>I&#8217;ve been looking at some of the vCheck 5 code looking for possible code improvements.  There are a few changes that I believe could simplify the script, but require PowerShell v2.  One that comes to mind would be using Send-MailMessage instead of a custom function that sends mail using the .Net properties.  In order to maintain backwards compatibility I have left this alone&#8230;until now!  While looking over the PowerCLI 5 (build 435426) <a href=\"http:\/\/www.vmware.com\/support\/developer\/PowerCLI\/PowerCLI50\/powercli50-20118-releasenotes.html\">release notes<\/a> I noticed the following heading:<\/p>\n<p><strong>Discontinued Support<\/strong><br \/>\nSupport for PowerShell 1.0 will be removed in the next PowerCLI release.<\/p>\n<p>This is important to note &#8212; and also means that I will start using more PowerShell 2 going forward.  The current build of vCheck I&#8217;m working on (5.45) will contain several improvements in the way output is addressed.  I&#8217;m planning on moving all of export tasks into a function within the configuration section of the script and switching the mail function to Send-MailMessage.  This will reduce the number of lines of code as the custom function can be removed and will also be easier for newer PowerShell users to understand.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been looking at some of the vCheck 5 code looking for possible code improvements. There are a few changes that I believe could simplify the script, but require PowerShell v2. One that comes to mind would be using Send-MailMessage &hellip; <a href=\"https:\/\/enterpriseadmins.org\/blog\/scripting\/powercli-vcheck-and-powershell-1-0-support\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"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,"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-665","post","type-post","status-publish","format-standard","hentry","category-scripting","category-virtualization"],"_links":{"self":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":3,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/665\/revisions"}],"predecessor-version":[{"id":668,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/665\/revisions\/668"}],"wp:attachment":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/media?parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/categories?post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/tags?post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}