{"id":621,"date":"2010-02-19T13:53:07","date_gmt":"2010-02-19T18:53:07","guid":{"rendered":"http:\/\/www.jasemccarty.com\/blog\/?p=621"},"modified":"2010-02-19T13:53:07","modified_gmt":"2010-02-19T18:53:07","slug":"powercli-script-with-voice","status":"publish","type":"post","link":"https:\/\/www.jasemccarty.com\/blog\/powercli-script-with-voice\/","title":{"rendered":"PowerCLI Script &#8211; With Voice"},"content":{"rendered":"<p>I was looking at some tweets, and noticed one from <strong><a title=\"@ScriptingGuys\" href=\"http:\/\/twitter.com\/ScriptingGuys\" target=\"_blank\">@ScriptingGuys<\/a><\/strong> about how to add voice to a PowerShell script.\u00a0 Here is the actual tweet: <strong><a title=\"http:\/\/twitter.com\/ScriptingGuys\/statuses\/9343448757\" href=\"http:\/\/twitter.com\/ScriptingGuys\/statuses\/9343448757\" target=\"_blank\">http:\/\/twitter.com\/ScriptingGuys\/statuses\/9343448757<\/a><\/strong><\/p>\n<p>Here&#8217;s the syntax in an example: <span style=\"color: #0000ff;\"><br \/>\n<span style=\"color: #000000;\">(New-Object  -ComObject sapi.spvoice).speak(&#8220;Greetings Professor Falken&#8221;)<br \/>\n<\/span><\/span><span style=\"color: #000000;\">(New-Object   -ComObject sapi.spvoice).speak(&#8220;Shall we play a game&#8221;)<\/span><\/p>\n<p>So I took one of my PowerShell scripts, and modified it.\u00a0 I chose my <strong><a title=\"PowerCLI: NFS Settings for vSphere (NetApp NFS Recommendations)\" href=\"http:\/\/www.jasemccarty.com\/blog\/?p=532\" target=\"_self\">PowerCLI: NFS Settings for vSphere (NetApp NFS Recommendations)<\/a><\/strong> script, because it is a short script, and it was easy to update.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n#***************************************************************************\n#\n# Update TCP and NFS Advanced Configuration Settings for vSphere w\/Voice\n# Author: Jase McCarty\n# Date: 2\/19\/2010\n#\n#***************************************************************************\n\n&lt;span style=&quot;color: #0000ff;&quot;&gt;(New-Object -ComObject sapi.spvoice).speak(&quot;What is the ESX Host Name or IP Address&quot;)&lt;\/span&gt;\n$ESXHOST = Read-Host \u201cEnter ESX Host Name or IP\u201d\nConnect-VIServer $ESXHOST\n\n&lt;span style=&quot;color: #0000ff;&quot;&gt; (New-Object -ComObject sapi.spvoice).speak(&quot;Now updating TCP and NFS Advanced Configuration Settings on host &quot; + $ESXHOST)&lt;\/span&gt;\nWrite-Host \u201cUpdating TCP and NFS Advanced Configuration Settings on host \u201d + $ESXHOST\n\n# Update TCP Settings\nSet-VMHostAdvancedConfiguration -VMHost $ESXHOST -Name Net.TcpipHeapSize  -Value 30\nSet-VMHostAdvancedConfiguration -VMHost $ESXHOST -Name Net.TcpipHeapMax  -Value 120\n\n# Update NFS Settings (For ESX 3.5, MaxVolumes should be 32)\nSet-VMHostAdvancedConfiguration -VMHost $ESXHOST -Name NFS.MaxVolumes  -Value 64\nSet-VMHostAdvancedConfiguration -VMHost $ESXHOST -Name  NFS.HeartbeatMaxFailures -Value 10\nSet-VMHostAdvancedConfiguration -VMHost $ESXHOST -Name  NFS.HeartbeatFrequency -Value 12\nSet-VMHostAdvancedConfiguration -VMHost $ESXHOST -Name  NFS.HeartbeatTimeout -Value 5\n\n(New-Object -ComObject sapi.spvoice).speak(&quot;NetApp Settings Complete&quot;)\n<\/pre>\n<p>Pretty cool addition.\u00a0 A good use of this, (as well as text prompts) would be when running commands against vCenter, &#8220;vocally&#8221; indicating changes to objects (hosts, clusters, guests, etc) as they are being modified.<\/p>\n<p>This might be a little much, but when running a script against many objects, it would not require having to watch the screen for output while the script is running.\u00a0 Attention could then be focused on other things.<\/p>\n<p>I don&#8217;t know if anyone is going to use this little addition, as it does take extra code.\u00a0 Administrators who approach scripts like I do (with many status messages and the like) might find this as a cool addition.<\/p>\n<p>Figured I&#8217;d share.<\/p>\n<div id=\"_mcePaste\" style=\"overflow: hidden; position: absolute; left: -10000px; top: 1309px; width: 1px; height: 1px;\">$NVPG = Get-VMHost $ESXHOST | Get-VirtualSwitch -Name &#8220;vSwitch0&#8221; | New-VirtualPortGroup -Name &#8220;VLAN100&#8221; -VLanId &#8220;100&#8221;;<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I was looking at some tweets, and noticed one from @ScriptingGuys about how to add voice to a PowerShell script.\u00a0 Here is the actual tweet: &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[58,65,109,111],"class_list":["post-621","post","type-post","status-publish","format-standard","hentry","category-virtualization","tag-nfs","tag-powercli","tag-voice","tag-vsphere"],"_links":{"self":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts\/621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/comments?post=621"}],"version-history":[{"count":0,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts\/621\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/media?parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/categories?post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/tags?post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}