 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Virtualization Pro &#187; Powershell</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/virtualization-pro/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/virtualization-pro</link>
	<description>A SearchVMware.com blog</description>
	<lastBuildDate>Fri, 22 Feb 2013 17:58:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>The vSphere API is not just for programmers</title>
		<link>http://itknowledgeexchange.techtarget.com/virtualization-pro/the-vsphere-api-is-not-just-for-programmers/</link>
		<comments>http://itknowledgeexchange.techtarget.com/virtualization-pro/the-vsphere-api-is-not-just-for-programmers/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 19:00:52 +0000</pubDate>
		<dc:creator>Halr9000</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Hal Rottenberg]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/virtualization-pro/?p=1088</guid>
		<description><![CDATA[The topic of the VMworld 2009 session which Luc Dekens and I gave recently was how to take PowerCLI to the next level. I&#8217;ll explain that premise for a bit in this post for those who may not have been able to make it to the session (or the show, for that matter). PowerCLI has [...]]]></description>
				<content:encoded><![CDATA[<p>The topic of the VMworld 2009 session which <a href="http://lucd.info/">Luc Dekens</a> and I gave recently was how to take <a href="http://vmware.com/go/powercli">PowerCLI</a> to the next level. I&#8217;ll explain that premise for a bit in this post for those who may not have been able to make it to the session (or the show, for that matter).</p>
<p>PowerCLI has a lot of functionality built in. As of this writing, there are 165 cmdlets that let you do a wide range of tasks such as starting virtual machines or creating virtual switches. Cmdlets are great because they are high-level, task-based, and their usage is mostly consistent across all domains, whether you are talking about virtualization or managing your mail servers.</p>
<p>Here&#8217;s a PowerShell command which will display all of the various types of objects which you can manipulate with PowerCLI. <span id="more-1088"></span>As you can see from the output, the scope is pretty broad:</p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">PS &gt; Get-VICommand | sort noun | group noun | Format-Wide name<br />
</span></p>
<p style="margin-left: 7pt">
<p style="margin-left: 7pt"><span style="font-family: Consolas">CDDrive                                   Cluster<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">CustomField                               Datacenter<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">Datastore                                 DrsRule<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">FloppyDrive                               Folder<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">HardDisk                                  Inventory<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">Log                                       LogType<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">NetworkAdapter                            OSCustomizationSpec<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">ResourcePool                              ScsiLun<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">ScsiLunPath                               Snapshot<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">Stat                                      StatInterval<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">StatType                                  Task<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">Template                                  Tools<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VICredentialStoreItem                     VIEvent<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">View                                      VIObjectByVIView<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VirtualPortGroup                          VirtualSwitch<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VIServer                                  VIToolkitConfiguration<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VIToolkitVersion                          VM<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMGuest                                   VMHost<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostAccount                             VMHostAdvancedConfiguration<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostDiagnosticPartition                 VMHostFirewallDefaultPolicy<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostFirewallException                   VMHostFirmware<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostModule                              VMHostNetwork<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostNetworkAdapter                      VMHostNtpServer<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostProfile                             VMHostProfileCompliance<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostService                             VMHostSnmp<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostStartPolicy                         VMHostStorage<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMHostSysLogServer                        VMResourceConfiguration<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">VMScript                                  VMStartPolicy<br />
</span></p>
<p>Even so, the vSphere application programming interface (API) is so large that there are still an astonishing number of things which are not handled by the existing set of cmdlets. Sure, VMware continues to work on this toolkit and to expand its capabilities — the rumor is that over 200 cmdlets will ship with version 4.1 &#8212; but the team that works on PowerShell is limited by time and resources, so it&#8217;s doubtful that they&#8217;ll reach parity with the API anytime soon.</p>
<p>Luckily, there is a release valve — a hidden door, if you like, that will let you go behind the scenes to go where no VMware Infrastructure (oops, meant to say vSphere) admin has gone before. The name of that hidden door is the <strong>Get-View</strong> cmdlet. &#8220;Get&#8221; in the PowerShell world just means to retrieve an object from somewhere. But what is it really that you are getting? You are getting an unfiltered view of the &#8220;managed objects&#8221; which make up the heart of the API. Once you have that view, you can do anything you want which the underlying API supports.</p>
<p>Here is a quick example of the sort of cool things you can see with Get-View:</p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">PS &gt; $h = Get-VMHost | Get-View<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">PS &gt; $h.Summary.Config.Product<br />
</span></p>
<p style="margin-left: 7pt">
<p style="margin-left: 7pt"><span style="font-family: Consolas">Name                  : VMware ESX<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">FullName              : VMware ESX 4.0.0 build-164009<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">Vendor                : VMware, Inc.<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">Version               : 4.0.0<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">Build                 : 164009<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">LocaleVersion         : INTL<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">LocaleBuild           : 000<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">OsType                : vmnix-x86<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">ProductLineId         : esx<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">ApiType               : HostAgent<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">ApiVersion            : 4.0<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">InstanceUuid          :<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">LicenseProductName    : VMware ESX Server<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">LicenseProductVersion : 4.0<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">DynamicType           :<br />
</span></p>
<p style="margin-left: 7pt"><span style="font-family: Consolas">DynamicProperty       :<br />
</span></p>
<p>And now you know how to write a script to make sure your host servers are all on the same patch level!</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/virtualization-pro/the-vsphere-api-is-not-just-for-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell is for Windows and Linux developers</title>
		<link>http://itknowledgeexchange.techtarget.com/virtualization-pro/powershell-for-windows-and-linux-developers/</link>
		<comments>http://itknowledgeexchange.techtarget.com/virtualization-pro/powershell-for-windows-and-linux-developers/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 16:45:26 +0000</pubDate>
		<dc:creator>Texiwill</dc:creator>
				<category><![CDATA[Edward L. Haletky]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[Expect]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Texiwill]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/virtualization-pro/?p=480</guid>
		<description><![CDATA[I have had several major issues with PowerShell (and still do), but that was mainly due to lack of cmdlets rather than lack of PowerShell functionality. So am I now one of the converted, given VMware&#8217;s integration with PowerShell? Yes and no. Yes, because to me, PowerShell is just another scripting language. No, because I want a scripting [...]]]></description>
				<content:encoded><![CDATA[<p>I have had several major issues with PowerShell (and still do), but that was mainly due to lack of cmdlets rather than lack of PowerShell functionality. So am I now one of the converted, given VMware&#8217;s integration with PowerShell? Yes and no.</p>
<p>Yes, because to me, PowerShell is just another scripting language.</p>
<p>No, because I want a scripting language that works well on all operating systems.  (People will suggest Java, but that is another blog post.)</p>
<p>I wrote a Perl application that would log in to an ESX host, run an assessment of its configuration and from there aid me in judging the security of the host and some smaller parts of the virtual environment. Since it was written in Perl, it would be hard to get people to use excepting myself and other Perl users. This breed is found mostly within the Linux world; many VMware infrastructure administrators may not understand Perl well as it comes with a learning curve.</p>
<p>So I went looking at various other tools and discovered <a href="http://www.powergui.org/index.jspa" target="_blank">PowerGUI</a>. PowerGUI is a great tool that has PowerPacks of prewritten PowerShell cmdlets that can run within the GUI.</p>
<p>There is a PowerPack for the VMware Infrastructure Toolkit, Hyper-V and Xen. The idea is to present a graphical interface for PowerShell cmdlets. This is just the interface I wanted for my tool, something I could plug into with ease to present the information in a way my users would easily understand with very little fuss. For them, it just has to work easily.</p>
<p>Unfortunately, PowerShell did not have the major facility I needed to make this work. It does not natively support secure shell and Expect functionality. <a href="http://expect.nist.gov/" target="_blank">Expect</a> functionality allows a script to wait for predetermined output from a log-in session (or any other session) that often requires a password . Expect is a very valuable addition to any Linux programmers toolbox.</p>
<p>After posting my questions to the PowerShell channel on irc.freenode.net, I received some answers to my simple PowerShell programming questions. I also used Google searches to find how specific objects worked within PowerShell versus pre-existing cmdlets.  Jaykul, a helpful participant on the irc channel, went even further to assist me by developing a set of SSH routines using the <a href="http://sourceforge.net/projects/sharpssh" target="_blank">SharpSSH client</a> written in .NET that actually has <a href="http://huddledmasses.org/scriptable-ssh-from-powershell" target="_blank">embedded Expect functionality</a>. This type of assistance within a scripting community is outstanding. It shows that the backers really want PowerShell to be a success, and that Powershell can make use of any .NET library on a system.</p>
<p>This, combined with help from PowerGUI guru Scott Herold, will allow me to plug my tool into the PowerPack for VMware Virtualization as an action that can run on each ESX host or cluster as needed. This also implies I can worry about the guts of the code and leave the UI to someone else entirely.</p>
<p>After combining PowerGUI, the VMware Infrastructure Toolkit PowerPack and Jaykul&#8217;s Scritable SSH cmdlets I was off and running. My tool works for me and should be easy to understand for others, meaning it will work without tweaking and very few downloads, namely just As in it JUST WORKS with no twiddling and very few downloads, namely PowerShell and perhaps PowerGUI.</p>
<p>So as a long time Linux-centric developer, I have finally found a scripting language for Windows that works well. It is missing functionality that I am used to, but the community is extremely active and very helpful.  For additional help, check out the <a href="http://get-scripting.blogspot.com/" target="_blank">Get Scripting Powershell podcast </a>.</p>
<p>There are great scripts for the PowerShell version of the VMware Infrastructure Toolkit, and the list is growing daily. Be sure to bookmark <a href="http://www.vmguru.com/index.php/articles-mainmenu-62/scripting/79-alans-vdiagram-powershell-script" target="_blank">Alan Renouf&#8217;s vDiagram script </a> and his blog <a href="http://teckinfo.blogspot.com/" target="_blank">Virtu-AI</a>. You&#8217;ll find  many blog posts on PowerShell tools and links to useful scripts.</p>
<p>Now if they could make PowerShell run on Linux and Mac systems!</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/virtualization-pro/powershell-for-windows-and-linux-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
