<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Robert van den Nieuwendijk&#039;s Blog</title>
	<atom:link href="http://rvdnieuwendijk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rvdnieuwendijk.com</link>
	<description>About VMware vSphere and Microsoft Windows PowerShell</description>
	<lastBuildDate>Sat, 08 Jun 2013 07:21:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rvdnieuwendijk.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/6362f44a8d505cfb215c658c71b588c2?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Robert van den Nieuwendijk&#039;s Blog</title>
		<link>http://rvdnieuwendijk.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rvdnieuwendijk.com/osd.xml" title="Robert van den Nieuwendijk&#039;s Blog" />
	<atom:link rel='hub' href='http://rvdnieuwendijk.com/?pushpress=hub'/>
		<item>
		<title>Upgrading your VMFS datastores with PowerCLI</title>
		<link>http://rvdnieuwendijk.com/2013/06/05/upgrading-your-vmfs-datastores-with-powercli/</link>
		<comments>http://rvdnieuwendijk.com/2013/06/05/upgrading-your-vmfs-datastores-with-powercli/#comments</comments>
		<pubDate>Wed, 05 Jun 2013 17:47:12 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[advanced function]]></category>
		<category><![CDATA[datastore]]></category>
		<category><![CDATA[Upgrade]]></category>
		<category><![CDATA[Upgrade-VmfsDatastore]]></category>
		<category><![CDATA[vmfs]]></category>
		<category><![CDATA[VMFS-3]]></category>
		<category><![CDATA[VMFS-5]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=930</guid>
		<description><![CDATA[With the release of VMware vSphere 5.0 a new version of the VMFS datastores was released also: VMFS-5. This new VMFS-5 version has a lot of advantages over the old VMFS-3 version (see for information about the new features Cormac Hogan&#8217;s post vSphere 5.0 Storage Features Part 1 – VMFS-5). You can upgrade your VMFS-3 [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=930&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif"><img src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif?w=630" alt="PowerCLI logo"   class="alignleft size-full wp-image-68" /></a>With the release of VMware vSphere 5.0 a new version of the VMFS datastores was released also: VMFS-5. This new VMFS-5 version has a lot of advantages over the old VMFS-3 version (see for information about the new features Cormac Hogan&#8217;s post <a href="http://blogs.vmware.com/vsphere/2011/07/new-vsphere-50-storage-features-part-1-vmfs-5.html">vSphere 5.0 Storage Features Part 1 – VMFS-5</a>). You can upgrade your VMFS-3 datastores to VMFS-5 while VM&#8217;s on the datastores keep running. In this post I will show you the vSphere PowerCLI Upgrade-VmfsDatastore function that will do the upgrade for you.<span id="more-930"></span></p>
<h1>The Upgrade-VmfsDatastore function</h1>
<p>The Upgrade-VmfsDatastore function is a PowerShell advanced function that will accept input from the pipeline. You can specify the datastores that you want to upgrade as input. If you use the -WhatIf parameter it will only show what the function would do, but it will not really do it. This is a great way to see in advance which datastore can be upgraded, if you use the output of the Get-Datastore cmdlet as input.</p>
<pre class="brush: powershell; title: ; notranslate">
function Upgrade-Vmfsdatastore {
&lt;#
  .SYNOPSIS
    Upgrades a VMFS datastore.

  .DESCRIPTION
    Upgrades a VMFS datastore from VMFS 3 to VMFS 5. 

  .PARAMETER  Datastore
    Specifies the datastores you want to upgrade.
    
  .PARAMETER  WhatIf
    Shows what would happen if the function runs. The function is not run.

  .EXAMPLE
    PS C:\&gt; Upgrade-VmfsDatastore -Datastore (Get-Datastore -Name Datastore1,Datastore2)
    Upgrades VMFS datastores Datastore1 and Datastore2 to VMFS 5.

  .EXAMPLE
    PS C:\&gt; Get-Datastore | Upgrade-VmfsDatastore
    Upgrades all VMFS datastores to VMFS5.

  .INPUTS
    VmfsDatastoreImpl

  .OUTPUTS
    VmfsDatastoreImpl

  .NOTES
    Author:  Robert van den Nieuwendijk
    Date:    5-6-2013
    Version: 1.0
 
  .LINK

http://rvdnieuwendijk.com/


http://twitter.com/rvdnieuwendijk

#&gt;

  [CmdletBinding()]
  [OutputType([VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl])]
  param(
    [parameter(Mandatory = $true,
               ValueFromPipeline = $true,
               ValueFromPipelineByPropertyName = $true)]
    [VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.VmfsDatastoreImpl[]] $Datastore,
    [Switch] $WhatIf
  )

  process {
    foreach ($CurrentDatastore in $Datastore |
      Where-Object {
        $_.GetType().Name -eq 'VmfsDatastoreImpl' -and $_.FileSystemVersion -lt 5
      }
    )
    {
      # If -WhatIf is used, only show what the function would do and don't really do it
      if ($WhatIf)
      {
        Write-Output &quot;What if: Performing operation &quot;&quot;Upgrade-VmfsDatastore&quot;&quot; on Target &quot;&quot;$($Datastore.Name)&quot;&quot;.&quot;
      }
      else
      {
        # Get the HostStorageSystem of the first host that the datastore is connected to
        # The UpgradeVmfs() method of this object is used to upgrade the datastore
        $HostStorageSystem = $CurrentDatastore |
          Get-VMHost | Select-Object -First 1 |
          Get-VMHostStorage | Get-View

        # Construct the path to the volume to upgrade
        # For example: /vmfs/volumes/4e97fa06-7fa61558-937e-984be163eb88
        $Volume = '/' + $CurrentDatastore.ExtensionData.Info.Url.TrimStart('ds:/').TrimEnd('/')
        
        # Upgrade the datastore
        $HostStorageSystem.UpgradeVmfs($Volume)
        
        # Return the datastore that has been upgraded
        $Datastore
      }
    }
  }
}
</pre>
<p>Listing 1. The Upgrade-VmfsDatastore function</p>
<p>There are some examples in the Upgrade-VmfsDatastore function&#8217;s comment-based help. Here are some more:<br />
<code><br />
PowerCLI C:\&gt; Get-Datastore -Name Datastore1 |  Upgrade-VmfsDatastore -WhatIf<br />
What if: Performing operation "Upgrade-VmfsDatastore" on Target "Datastore1".<br />
PowerCLI C:\&gt; Get-Datastore -Name Datastore1 |  Upgrade-VmfsDatastore</p>
<p>Name                               FreeSpaceGB      CapacityGB<br />
----                               -----------      ----------<br />
Datastore1                             103,861         499,750<br />
</code><br />
I would love to hear it when you use the Upgrade-VmfsDatastore function to upgrade your datastores.</p>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/930/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/930/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=930&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2013/06/05/upgrading-your-vmfs-datastores-with-powercli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif" medium="image">
			<media:title type="html">PowerCLI logo</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerCLI Get-VICommand function error repaired</title>
		<link>http://rvdnieuwendijk.com/2013/02/24/powercli-get-vicommand-function-error-repaired/</link>
		<comments>http://rvdnieuwendijk.com/2013/02/24/powercli-get-vicommand-function-error-repaired/#comments</comments>
		<pubDate>Sun, 24 Feb 2013 13:05:48 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[$PSModuleAutoloadingPreference]]></category>
		<category><![CDATA[dot sourcing]]></category>
		<category><![CDATA[Get-Command]]></category>
		<category><![CDATA[Get-VICommand]]></category>
		<category><![CDATA[Object reference not set to an instance of an object]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=875</guid>
		<description><![CDATA[On my PC (Windows 8 Pro, Windows PowerShell 3 and VMware vSphere PowerCLI 5.1 Release 2) there is a very annoying problem with the Get-VICommand function. If I use this function without specifying the name of a cmdlet to search for, then I get an &#8220;Object reference not set to an instance of an object&#8221; [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=875&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif"><img src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif?w=630" alt="PowerCLI logo"   class="alignleft size-full wp-image-68" /></a>On my PC (Windows 8 Pro, Windows PowerShell 3 and VMware vSphere PowerCLI 5.1 Release 2) there is a very annoying problem with the Get-VICommand function. If I use this function without specifying the name of a cmdlet to search for, then I get an &#8220;Object reference not set to an instance of an object&#8221; error message:</p>
<pre class="brush: plain; title: ; notranslate">
PowerCLI C:\users\robert&gt; Get-VICommand
get-command : Object reference not set to an instance of an object.
At C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1:68 char:3
+   get-command -pssnapin VMware.* -Name $Name
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-Command], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetCommandCommand
</pre>
<p> Listing 1. Get-VICommand error message with PowerShell 3.<br />
<span id="more-875"></span><br />
As you can see in the error message, the error is thrown by the Get-Command cmdlet. This is because Get-VICommand is a function that calls the Get-Command cmdlet. The function is defined in the Initialize-PowerCLIEnvironment.ps1 file. You can see the complete path to this file in the above error message.</p>
<pre class="brush: powershell; title: ; notranslate">
function global:Get-VICommand([string] $Name = &quot;*&quot;) {
  get-command -pssnapin VMware.* -Name $Name
}
</pre>
<p> Listing 2. Original version  of the Get-VICommand function.</p>
<p>The Get-VICommand function calls the Get-Command cmdlet with a wildcard for the -pssnapin parameter value. This is what causes the problem. For some reason this does not work on my PC. Probably because of some other conflicting software that I have installed. I have not found yet what exactly causes this problem.</p>
<p>To work around this problem I created a new version of the Get-VICommand function that enumerates all the VMware snapins and calls Get-Command for each of them.</p>
<pre class="brush: powershell; title: ; notranslate">
function global:Get-VICommand([string] $Name = &quot;*&quot;) {
  &amp;{ foreach ($PSSnapin in (Get-PSSnapin -Name vmware.*))
     {
       Get-Command -PSSnapin $PSSnapin -Name $Name -ErrorAction:SilentlyContinue
     }
  } |
  Sort-Object -Property Name
}
</pre>
<p> Listing 3. New version of the Get-VICommand function.</p>
<p>If you have this problem also then put the new version of the Get-VICommand function in a file called Get-VICommand.ps1. You can then load the function to your PowerCLI session by dot sourcing the file. For example:</p>
<pre class="brush: powershell; title: ; notranslate">
PowerCLI C:\&gt; . .\Get-VICommand.ps1
</pre>
<p> Listing 4. Load the function in the Get-VICommand.ps1 file to your PowerCLI session by dot sourcing.</p>
<p>Now you can use the new Get-VICommand function in your PowerCLI session.</p>
<p>Have fun with PowerCLI!</p>
<p><strong><span style="background-color:#ffff00;">Update 24-2-2013</span></strong><br />
While searching for the root cause of this problem, I discovered that you can also solve it by disabling PowerShell v3 module auto loading. You can do this with the following command:</p>
<pre class="brush: powershell; title: ; notranslate">
$PSModuleAutoloadingPreference = 'none'
</pre>
<p> Listing 4. PowersShell v3 command to disable module auto loading.</p>
<p>Put this command in your PowerShell profile to disable PowerShell v3 module auto loading for all your PowerShell sessions. You can edit your profile with:</p>
<pre class="brush: powershell; title: ; notranslate">
notepad $profile
</pre>
<p> Listing 5. PowerShell command to edit your PowerShell profile.</p>
<p>The disadvantage of disabling PowerShell module auto loading is that you have to load all the modules you use explicitly using the Import-Module cmdlet. The advantage is that the Get-VICommand function and Get-Command cmdlet are working again.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/875/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/875/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=875&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2013/02/24/powercli-get-vicommand-function-error-repaired/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif" medium="image">
			<media:title type="html">PowerCLI logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Get VMware vCenter Scheduled Tasks with PowerCLI</title>
		<link>http://rvdnieuwendijk.com/2013/01/19/get-vmware-vcenter-scheduled-tasks-with-powercli/</link>
		<comments>http://rvdnieuwendijk.com/2013/01/19/get-vmware-vcenter-scheduled-tasks-with-powercli/#comments</comments>
		<pubDate>Sat, 19 Jan 2013 16:16:03 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[advanced function]]></category>
		<category><![CDATA[Get-VCScheduledTask]]></category>
		<category><![CDATA[scheduled task]]></category>
		<category><![CDATA[splatting]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=827</guid>
		<description><![CDATA[VMware vSphere PowerCLI is missing cmdlets to work with VMware vCenter Scheduled Tasks. In a series of blog posts I will show you some PowerShell advanced functions that you can use to work with vCenter Scheduled Tasks. The first function is Get-VCScheduledTask. You can use this function to retrieve one or more scheduled tasks from [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=827&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.com/2011/07/17/how-to-use-vmware-vsphere-powercli-to-find-an-esxesxi-server-by-mac-address/powercli-logo/" rel="attachment wp-att-68"><img src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif?w=630" alt="PowerCLI logo"   class="alignleft size-full wp-image-68" /></a>VMware vSphere PowerCLI is missing cmdlets to work with VMware vCenter Scheduled Tasks. In a series of blog posts I will show you some PowerShell advanced functions that you can use to work with vCenter Scheduled Tasks. The first function is Get-VCScheduledTask. You can use this function to retrieve one or more scheduled tasks from your vCenter Server.<span id="more-827"></span></p>
<h1>The Get-VCScheduledTask function</h1>
<pre class="brush: powershell; title: ; notranslate">
function Get-VCScheduledTask {
&lt;#
  .SYNOPSIS
    Retrieves the scheduled tasks on a vCenter Server.

  .DESCRIPTION
    Retrieves the scheduled tasks on a vCenter Server.

  .PARAMETER  Name
    Specify the name of the scheduled tasks you want to retrieve. If no value is
    given to this parameter, the command returns all the scheduled tasks.

  .PARAMETER  Server
    Specify the vCenter server to apply the command on. If no value is given to
    this parameter, the command runs on the server currently specified in the
    $DefaultVIServers variable.

  .EXAMPLE
    PS C:\&gt; Get-VCScheduledTask -Server vCenter
    Retrieves all the scheduled tasks for the vCenter server named vCenter.

  .EXAMPLE
    PS C:\&gt; Get-VCScheduledTask -Name &quot;*Update Manager*&quot;
    Retrieves all the VMware vSphere Update Manager scheduled tasks.

  .INPUTS
    System.String

  .OUTPUTS
    PSCustomObject

  .NOTES
    Author:  Robert van den Nieuwendijk
    Date:    17-1-2013
    Version: 1.0

  .LINK

http://rvdnieuwendijk.com/


http://twitter.com/rvdnieuwendijk

#&gt;

  [CmdletBinding()]
  [OutputType([PSObject])]
  
  # Parameter definitions
  param([parameter(position=0)][string[]]$Name = &quot;*&quot;,
        [parameter(position=1)][string[]]$Server = &quot;*&quot;
  )

  # Loop through the servers
  foreach ($SingleServer in $Server) {
    # Loop through the scheduled task names
    foreach ($SingleName in $Name) {
      # Create the parameterset for the Get-View cmdlet
      $GetViewParameterSet = @{
        Id = &quot;ServiceInstance&quot;
       } 
      if ($SingleServer)
      {
        $GetViewParameterSet += @{
          Server = $SingleServer
        }
      }  

      # Get the ScheduledTaskManager objects
      $ServiceInstance = Get-View @GetViewParameterSet
      $ScheduledTaskManager = $ServiceInstance |
        ForEach-Object {
          if ($_)
          {
            Get-View -Id $_.Content.ScheduledTaskManager
          }
        }
	
      # Get the scheduled tasks
      if ($ScheduledTaskManager) {
        Get-View -Id ($ScheduledTaskManager |
          Select -ExpandProperty ScheduledTask |
          Sort-Object -Unique) |
        Where-Object {
          $_.Info.Name -like $SingleName -and $_.Client.ServiceUrl.Split('/')[2].Split(':')[0] -like $SingleServer
        } |
        ForEach-Object {
          if ($_)
          {
            $ScheduledTask = $_

            # Find the server
            $VIServer = $global:DefaultVIServers |
              Where-Object {
                $_.Name -eq $ScheduledTask.Client.ServiceUrl.Split('/')[2].Split(':')[0]
              }
			
            # Create the output objects
            New-Object -TypeName PSObject -Property @{
              Name = $ScheduledTask.Info.Name
              Description = $ScheduledTask.Info.Description
              Action = $ScheduledTask.Info.Action
              EntityId = $ScheduledTask.Info.Entity
              Entity = $ScheduledTask.Info.Entity |
                Get-VIObjectByVIView -Server $VIServer
              Enabled = $ScheduledTask.Info.Enabled
              Notification = $ScheduledTask.Info.Notification
              State = $ScheduledTask.Info.State
              Progress = $ScheduledTask.Info.Progress
              LastModifiedTime = $ScheduledTask.Info.LastModifiedTime
              LastModifiedUser = $ScheduledTask.Info.LastModifiedUser
              NextRunTime = $ScheduledTask.Info.NextRunTime
              PrevRunTime = $ScheduledTask.Info.PrevRunTime
              Scheduler = $ScheduledTask.Info.Scheduler
              ExtensionData = $ScheduledTask
              Id = $ScheduledTask.MoRef
              Uid = &quot;/VIServer=$($VIServer.User)@$($ScheduledTask.Client.ServiceUrl.Split('/')[2])/ScheduledTask=$($ScheduledTask.MoRef)/&quot;
              Client = $ScheduledTask.Client
            } |
            Select-Object -Property Name,Description,Action,EntityId,Entity,Enabled,
              Notification,State,Progress,LastModifiedTime,LastModifiedUser,
              NextRunTime,PrevRunTime,Scheduler,ExtensionData,Id,Uid,Client
          }
        }
      }
    }
  }
}
</pre>
<p> Listing 1. The Get-VCScheduledTask function to retrieve VMware vCenter Scheduled tasks.</p>
<h4>Annotations</h4>
<p><strong>Line 47-48</strong>: Both parameters are defined as [string[]]. That means that you can specify an array as the value of the parameter.</p>
<p><strong>Line 55-64</strong>: A PowerShell technique called splatting is used to create the parameter set of the Get-View cmdlet used in line 67.</p>
<p><strong>Line 67</strong>: The GetViewParameterSet variable is used as a parameter to the Get-View cmdlet. Notice that it is used as @GetViewParameterSet without a $ sign.</p>
<p><strong>Line 117-119</strong>: The output of the New-Object cmdlet on line 96-116 can have it properties in an unsorted order. The Select-Object cmdlet orders the properties.</p>
<h2>Sample output</h2>
<p>The objects that the Get-VCScheduledTask function returns look like the objects that the PowerCLI Get-* cmdlets return. The objects have a Name, ExtensionData, Id, Uid and Client property.</p>
<pre class="brush: plain; title: ; notranslate">
PowerCLI C:\users\robert&gt; Get-VCScheduledtask


Name             : VMware vCenter Update Manager Update Download
Description      : A pre-defined scheduled task to download software patch definitions.
Action           : VMware.Vim.CreateTaskAction
EntityId         : Folder-group-d1
Entity           : Datacenters
Enabled          : True
Notification     :
State            : success
Progress         :
LastModifiedTime : 6-11-2012 14:25:44
LastModifiedUser : com.vmware.vcIntegrity
NextRunTime      : 18-1-2013 03:10:00
PrevRunTime      : 17-1-2013 03:10:00
Scheduler        : VMware.Vim.DailyTaskScheduler
ExtensionData    : VMware.Vim.ScheduledTask
Id               : ScheduledTask-schedule-101
Uid              : /VIServer=rvdnieuwendijk\robert@vcenter:443/ScheduledTask=ScheduledTask-schedule-101/
Client           : VMware.Vim.VimClient

Name             : VMware vCenter Update Manager Check Notification
Description      : A pre-defined scheduled task to check update notifications.
Action           : VMware.Vim.CreateTaskAction
EntityId         : Folder-group-d1
Entity           : Datacenters
Enabled          : True
Notification     :
State            : success
Progress         :
LastModifiedTime : 6-11-2012 14:25:45
LastModifiedUser : com.vmware.vcIntegrity
NextRunTime      : 17-1-2013 20:04:00
PrevRunTime      : 17-1-2013 19:04:00
Scheduler        : VMware.Vim.HourlyTaskScheduler
ExtensionData    : VMware.Vim.ScheduledTask
Id               : ScheduledTask-schedule-102
Uid              : /VIServer=rvdnieuwendijk\robert@vcenter:443/ScheduledTask=ScheduledTask-schedule-102/
Client           : VMware.Vim.VimClient

Name             : Power on storage-test
Description      :
Action           : VMware.Vim.MethodAction
EntityId         : VirtualMachine-vm-109
Entity           : storage-test
Enabled          : True
Notification     :
State            : success
Progress         :
LastModifiedTime : 3-1-2013 14:03:00
LastModifiedUser : rvdnieuwendijk\robert
NextRunTime      :
PrevRunTime      : 5-1-2013 15:02:00
Scheduler        : VMware.Vim.OnceTaskScheduler
ExtensionData    : VMware.Vim.ScheduledTask
Id               : ScheduledTask-schedule-201
Uid              : /VIServer=rvdnieuwendijk\robert@vcenter:443/ScheduledTask=ScheduledTask-schedule-201/
Client           : VMware.Vim.VimClient



PowerCLI C:\users\robert&gt;
</pre>
<p> Output 1. Sample output of the Get-VCscheduledTask function.</p>
<p>Have fun with scheduled tasks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/827/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/827/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=827&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2013/01/19/get-vmware-vcenter-scheduled-tasks-with-powercli/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif" medium="image">
			<media:title type="html">PowerCLI logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Use PowerCLI to consolidate snapshots in vSphere 5</title>
		<link>http://rvdnieuwendijk.com/2012/09/26/use-powercli-to-consolidate-snapshots-in-vsphere-5/</link>
		<comments>http://rvdnieuwendijk.com/2012/09/26/use-powercli-to-consolidate-snapshots-in-vsphere-5/#comments</comments>
		<pubDate>Wed, 26 Sep 2012 19:02:13 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[ConsolidateVMDisks]]></category>
		<category><![CDATA[ConsolidateVMDisks_Task]]></category>
		<category><![CDATA[consolidation]]></category>
		<category><![CDATA[ConsolidationNeeded]]></category>
		<category><![CDATA[Disk]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[virtual machine]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=774</guid>
		<description><![CDATA[In vSphere 5 a virtual machine can have a &#8220;Virtual machine disks consolidation is needed&#8221; Configuration Issue warning in the Summary tab. How can you use PowerCLI to see which virtual machines have this warning? And how can you automate the consolidation of the virtual machine&#8217;s disks? List virtual machines that need disks consolidation The [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=774&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif"><img src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif?w=630" alt="PowerCLI logo" title="PowerCLI-logo"   class="alignleft size-full wp-image-68" /></a>In vSphere 5 a virtual machine can have a &#8220;Virtual machine disks consolidation is needed&#8221; Configuration Issue warning in the Summary tab. How can you use PowerCLI to see which virtual machines have this warning? And how can you automate the consolidation of the virtual machine&#8217;s disks?<span id="more-774"></span></p>
<h1>List virtual machines that need disks consolidation</h1>
<p>The PowerCLI command in listing 1 will return all the virtual machines that need disk consolidation.</p>
<pre class="brush: powershell; title: ; notranslate">
Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded}
</pre>
<p> Listing 1. PowerCLI command to list all virtual machines that need disk consolidation.</p>
<h1>Consolidate a virtual machine&#8217;s disks</h1>
<p>The PowerCLI command in listing 2 will consolidate the disks of a virtual machine called MyVM. The command will not wait untill the consolidation is finished but will return immediately.</p>
<pre class="brush: powershell; title: ; notranslate">
(Get-VM -Name &quot;MyVM&quot;).ExtensionData.ConsolidateVMDisks_Task()
</pre>
<p> Listing 2. PowerCLI command to consolidate the disks of a virtual machine called MyVM.</p>
<p>If you want to wait until the task is finished before continuing with your PowerCLI script, you need to use the ConsolidateVMDisks method:</p>
<pre class="brush: powershell; title: ; notranslate">
(Get-VM -Name &quot;MyVM&quot;).ExtensionData.ConsolidateVMDisks()
</pre>
<p> Listing 3. PowerCLI command to consolidate the disks of a virtual machine called MyVM and wait untill the task is finished.</p>
<h1>Consolidate the disks of all virtual machine&#8217;s that need it</h1>
<p>When you want to consolidate the disks of all virtual machines that need disks consolidation then you can use the script from listing 4.</p>
<pre class="brush: powershell; title: ; notranslate">
Get-VM |
Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded} |
ForEach-Object {
  $_.ExtensionData.ConsolidateVMDisks()
}
</pre>
<p> Listing 4. PowerCLI script to consolidate the disks of all virtual machines that need disks consolidation. The script will wait untill the consolidation of the disks of a virtual machine is finished before continuing with the next virtual machine.</p>
<h1>Link</h1>
<p>The following VMWare Knowledge Base article will give you more information about consolidating snapshots in vSphere 5:<br />
<a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=2003638">Consolidating snapshots in vSphere 5</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/774/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=774&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2012/09/26/use-powercli-to-consolidate-snapshots-in-vsphere-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif" medium="image">
			<media:title type="html">PowerCLI-logo</media:title>
		</media:content>
	</item>
		<item>
		<title>1st Dutch PowerShell User Group (DuPSUG) meeting</title>
		<link>http://rvdnieuwendijk.com/2012/09/12/1th-dutch-powershell-user-group-dupsug-meeting/</link>
		<comments>http://rvdnieuwendijk.com/2012/09/12/1th-dutch-powershell-user-group-dupsug-meeting/#comments</comments>
		<pubDate>Wed, 12 Sep 2012 07:42:07 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[DuPSUG]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=760</guid>
		<description><![CDATA[Friday, November 23, 2012 the first Dutch PowerShell User group (DuPSUG) meeting will be held in Eindhoven, The Netherlands. Speakers are: Microsoft Scripting Guy Ed Wilson, PowerShell MVP Richard Siddaway, Bert Wolters, Stefan Stranger and Jeff Wouters. Session topics are: Using Windows PowerShell 3.0 to manage the remote Windows 8 workstation PowerShell and WMI What’s [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=760&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<li><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png"><img src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png?w=630" alt="PowerShell logo" title="PowerShell-logo"   class="alignleft size-full wp-image-127" /></a>Friday, November 23, 2012 the first Dutch PowerShell User group (DuPSUG) meeting will be held in Eindhoven, The Netherlands. Speakers are:<br />
Microsoft Scripting Guy Ed Wilson, PowerShell MVP Richard Siddaway, Bert Wolters, Stefan Stranger and Jeff Wouters.</p>
<p>Session topics are:</p>
<ul>
<li>Using Windows PowerShell 3.0 to manage the remote Windows 8 workstation</li>
<li>PowerShell and WMI</li>
<li>What’s new in PowerShell 3.0</li>
<li>Protect your PowerShell scripts with version control</li>
<li>From command, to script, to function, to advanced function, to tool</li>
</ul>
<p>More information can be found at: <a href="http://www.dupsug.com/?page_id=65">1st DuPSUG meeting</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/760/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/760/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=760&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2012/09/12/1th-dutch-powershell-user-group-dupsug-meeting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png" medium="image">
			<media:title type="html">PowerShell-logo</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerShell 3.0 is available for download</title>
		<link>http://rvdnieuwendijk.com/2012/09/05/powershell-3-0-is-available-for-download/</link>
		<comments>http://rvdnieuwendijk.com/2012/09/05/powershell-3-0-is-available-for-download/#comments</comments>
		<pubDate>Wed, 05 Sep 2012 18:58:26 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[PowerShell 3.0]]></category>
		<category><![CDATA[Windows Management Framework 3.0]]></category>
		<category><![CDATA[WinRM]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=735</guid>
		<description><![CDATA[Since September 4th 2012 is PowerShell 3.0 available for download. PowerShell 3.0 is included in the Windows Management Framework 3.0 that contains also WMI and WinRM. It can be installed on Windows 7 SP1, Windows Server 2008 R2 SP1 and Windows Server 2008 SP2. Windows Management Framework 3.0 requires Microsoft .NET Framework 4.0. PowerShell 3.0 is a standard component [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=735&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png"><img class="alignleft size-full wp-image-127" title="PowerShell-logo" src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png?w=630" alt="PowerShell logo"   /></a>Since September 4th 2012 is PowerShell 3.0 available for download. PowerShell 3.0 is included in the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=34595">Windows Management Framework 3.0</a> that contains also WMI and WinRM. It can be installed on Windows 7 SP1, Windows Server 2008 R2 SP1 and Windows Server 2008 SP2. Windows Management Framework 3.0 requires <a href="http://go.microsoft.com/fwlink/?LinkID=212547">Microsoft .NET Framework 4.0</a>. PowerShell 3.0 is a standard component of Windows 8 and Windows Server 2012.<span id="more-735"></span></p>
<h1>New features</h1>
<h3>Windows PowerShell 3.0</h3>
<p>Some of the new features in Windows PowerShell 3.0 include:</p>
<ul>
<li><strong>Workflow</strong><br />
Windows PowerShell Workflow lets IT Pros and developers apply the benefits of workflows to the automation capabilities of Windows PowerShell. Workflows allow administrators to run long-running tasks (which can be made repeatable, frequent, parallelizable, interruptible, or restart-able) that can affect multiple managed computers or devices at the same time.</li>
<li><strong>Disconnected Sessions</strong><br />
PowerShell sessions can be disconnected from the remote computer and reconnected later from the same computer or a different computer without losing state or causing running commands to fail.</li>
<li><strong>Robust Session Connectivity</strong><br />
Remote sessions are resilient to network failures and will attempt to reconnect for several minutes. If connectivity cannot be reestablished, the session will automatically disconnect itself so that it can be reconnected when network connectivity is restored.</li>
<li><strong>Scheduled Jobs</strong><br />
Scheduled jobs that run regularly or in response to an event.</li>
<li><strong>Delegated Administration</strong><br />
Commands that can be executed with a delegated set of credentials so users with limited permissions can run critical jobs</li>
<li><strong>Simplified Language Syntax</strong><br />
Simplified language syntax that make commands and scripts look a lot less like code and a lot more like natural language.</li>
<li><strong>Cmdlet Discovery</strong><br />
Improved cmdlet discovery and automatic module loading that make it easier to find and run any of the cmdlets installed on your computer.</li>
<li><strong>Show-Command</strong><br />
Show-Command, a cmdlet and ISE Add-On that helps users find the right cmdlet, view its parameters in a dialog box, and run it.</li>
</ul>
<h3>WMI</h3>
<p>WMI in Windows Management Framework 3.0 introduces:</p>
<ul>
<li><strong>A new provider development model</strong><br />
This new model brings down the cost of provider development and removes the dependency on COM.</li>
<li><strong>A new MI Client API to perform standard CIM operations</strong><br />
The API can be used to interact with any standard WsMan + CIMOM implementation, allowing management applications on Windows to manage non-Windows computers.</li>
<li><strong>The ability to write Windows PowerShell cmdlets in native code</strong><br />
The new WMI Provider APIs supports an extended Windows PowerShell semantics API allowing you to provide rich Windows PowerShell semantics. e.g., Verbose, Error, Warning, WhatIf, Confirm, Progress</li>
</ul>
<h3>WinRM</h3>
<p>With Windows Management Framework 3.0:</p>
<ul>
<li><strong>Connections are more robust</strong><br />
Remote connections communicating over WinRM are more robust to transient network failures such as a flaky WAN connection. In the case of a complete network failure, connections are gracefully disconnected and can be reconnected when network connectivity is restored.</li>
<li><strong>Remoting is more Standards-compliant</strong><br />
Standard WS-Management operations, including Create and Delete, can be performed over WMI. Remoting for cmdlets written in native code using the new WMI provider development model uses WS-Management instead of DCOM.</li>
<li><strong>Multiple PowerShell sessions can be shared in the same process</strong><br />
PowerShell sessions from the same user to the same session configuration (WinRM plug-in) can run in a single shared process instead of separate processes. This improves scalability and performance by allowing multiple sessions to share memory and other server resources.</li>
</ul>
<h3>Management OData IIS Extensions</h3>
<p>Management OData IIS Extension enables an administrator to expose a set of PowerShell cmdlets as a RESTful web endpoint accessible via the Open Data Protocol (OData). This enables Windows and non-Windows clients to discover and invoke PowerShell cmdlets remotely over standard web protocols and interfaces.</p>
<h3>Server Manager CIM Provider</h3>
<p>The Server Manager CIM Provider packaged with Windows Management Framework 3.0 allows you to manage your Windows Server 2008 R2 SP1 and Windows Server 2008 SP2 servers from Server Manager in Windows Server 2012 or <a href="http://go.microsoft.com/fwlink/p/?LinkID=238560">Remote Server Administration Tools for Windows 8</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/735/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/735/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=735&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2012/09/05/powershell-3-0-is-available-for-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png" medium="image">
			<media:title type="html">PowerShell-logo</media:title>
		</media:content>
	</item>
		<item>
		<title>How to list all the PowerCLI ESXCLI commands</title>
		<link>http://rvdnieuwendijk.com/2012/08/19/how-to-list-all-the-powercli-esxcli-commands/</link>
		<comments>http://rvdnieuwendijk.com/2012/08/19/how-to-list-all-the-powercli-esxcli-commands/#comments</comments>
		<pubDate>Sun, 19 Aug 2012 17:43:49 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vCLI]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[esxcli]]></category>
		<category><![CDATA[Get-EsxCli]]></category>
		<category><![CDATA[Get-EsxCliCommand]]></category>
		<category><![CDATA[Get-Member]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[vmfs]]></category>
		<category><![CDATA[VMTN]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=695</guid>
		<description><![CDATA[Last week there was a question in the VMware VMTN Communities VMware vSphere PowerCLI forum from Papires who asked how you can convert the ESXCLI command &#8216;esxcli storage vmfs snapshot mount -l &#8220;DATASTORE&#8221;&#8216; into a PowerCLI command. I had not done very much with ESXCLI in PowerCLI, but I knew that it was something like [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=695&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif"><img class="alignleft size-full wp-image-68" title="PowerCLI-logo" src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif?w=630" alt="PowerCLI logo"   /></a>Last week there was a <a title="question" href="http://communities.vmware.com/thread/414653?tstart=0" target="_blank">question</a> in the <a title="VMware vSphere PowerCLI forum" href="http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli?view=discussions&amp;start=0">VMware VMTN Communities VMware vSphere PowerCLI forum </a> from <a title="Papires" href="http://communities.vmware.com/people/Papires" target="_blank">Papires</a> who asked how you can convert the ESXCLI command &#8216;esxcli storage vmfs snapshot mount -l &#8220;DATASTORE&#8221;&#8216; into a PowerCLI command. I had not done very much with ESXCLI in PowerCLI, but I knew that it was something like &#8216;$esxcli.storage.vmfs.snapshot.mount&#8217;. However I was struggling with the &#8216;-l &#8220;DATASTORE&#8221;&#8216; part.</p>
<p>There is not much documentation available about the ESXCLI commands in PowerCLI. And also a search in Google did not help me very much. Finally I found the right answer using the PowerShell <a title="Get-Member" href="http://technet.microsoft.com/en-US/library/dd315351.aspx" target="_blank">Get-Member</a> cmdlet.<span id="more-695"></span></p>
<h1>Using the Get-EsxCli cmdlet</h1>
<p>If you want to use an ESXCLI command in PowerCLI you first have to create a EsxCliImpl object using the <a href="http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-EsxCli.html">Get-EsxCli</a> cmdlet. An example is shown in listing 2.</p>
<h1>The Get-Member cmdlet output</h1>
<p>The PowerCLI command &#8216;$esxcli.storage.vmfs.snapshot | Get-Member&#8217; gave me the following output:</p>
<pre class="brush: plain; title: ; notranslate">
   TypeName: VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl

Name             MemberType   Definition
----             ----------   ----------
list             CodeMethod   vim.EsxCLI.storage.vmfs.snapshot.list.VMFSSnapshot[] list(string volumelabel, string volumeuuid)
mount            CodeMethod   boolean mount(boolean nopersist, string volumelabel, string volumeuuid)
resignature      CodeMethod   boolean resignature(string volumelabel, string volumeuuid)
extent           CodeProperty VMware.VimAutomation.Sdk.Util10Ps.ObjectCustomization.SimpleExtensionProperty
ConvertToVersion Method       T VersionedObjectInterop.ConvertToVersion[T]()
Equals           Method       bool Equals(System.Object obj)
GetHashCode      Method       int GetHashCode()
GetType          Method       type GetType()
help             Method       VMware.VimAutomation.ViCore.Types.V1.EsxCli.EsxCliHelp help(), VMware.VimAutomation.ViCore.Types.V1.EsxCli.EsxCliMethodHelp help(string methodName), VMware.VimAutomat...
IsConvertableTo  Method       bool VersionedObjectInterop.IsConvertableTo(type type)
ToString         Method       string ToString()
Client           Property     VMware.VimAutomation.ViCore.Interop.V1.VIAutomation Client {get;}
FullName         Property     string FullName {get;}
Id               Property     string Id {get;}
Name             Property     string Name {get;}
Uid              Property     string Uid {get;}
</pre>
<p>Listing 1. Output of the PowerCLI &#8216;$esxcli.storage.vmfs.snapshot | Get-Member&#8217; command.</p>
<p>I now knew that the mount CodeMethod needs three parameters: nopersist, volumelabel and volumeuuid. Because Papires wanted to specify a volumelabel and probably wanted a persistent mount, I came to the following answer to his question.</p>
<pre class="brush: powershell; title: ; notranslate">
$esxcli = Get-EsxCli -VMHost &quot;YourHost&quot;
$esxcli.storage.vmfs.snapshot.mount($false,&quot;DATASTORE&quot;,$null)
</pre>
<p>Listing 2. PowerCLI equivalent of the ESXCLI &#8221;esxcli storage vmfs snapshot mount -l &#8220;DATASTORE&#8221;&#8216; command.</p>
<h1>The Get-EsxCliCommand function</h1>
<p>Because I could find the right answer using the Get-Member cmdlet, I decided to write a PowerCLI script that can give me all the possible PowerCLI ESXCLI commands.</p>
<p>The Get-EsxCliCommand PowerCLI function lists all the possible PowerCLI ESXCLI commands. It does this by using the PowerShell Get-Member cmdlet to list each CodeProperty property and CodeMethod method of the EsxCliImpl or EsxCliElementImpl object that is given as input. Then the function calls itself for each CodeProperty. A function like Get-EsxCliCommand that calls itself is called a recursive function.</p>
<pre class="brush: powershell; title: ; notranslate">
function Get-EsxCliCommand {
  &lt;#
    .SYNOPSIS
      Lists all the possible PowerCLI ESXCLI commands.

    .DESCRIPTION
      Lists all the possible PowerCLI ESXCLI commands.

    .PARAMETER EsxCli
      The VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliImpl or VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl object for which all the possible PowerCLI ESXCLI command must be returned.

    .PARAMETER Name
      The top level name of the listed commands. The default is '$esxcli'.

    .EXAMPLE
      PS C:\&gt; $esxcli = Get-EsxCli -VMhost ESX1.yourdomain.com
      PS C:\&gt; Get-EsxCliCommand -EsxCli $esxcli

      Lists all the PowerCLI ESXCLI commands for server ESX1.yourdomain.com. 

    .EXAMPLE
      PS C:\&gt; $esxcli = Get-EsxCli -VMhost ESX1.yourdomain.com
      PS C:\&gt; Get-EsxCliCommand -EsxCli $esxcli.network -Name '$esxcli.network'
			
      Lists all the PowerCLI ESXCLI network commands for server ESX1.yourdomain.com. 

    .INPUTS
      VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliImpl
	  VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl
	  System.String

    .OUTPUTS
      System.String

    .NOTES
      Author: Robert van den Nieuwendijk
      Version: 1.0
      Date: 19-8-2012

    .LINK

http://rvdnieuwendijk.com/

#&gt;

  [CmdletBinding()]
  [OutputType([string])]
  param(
    [parameter(Mandatory=$true,Position=0)]$EsxCli,
    [parameter(Position=1)][String[]]$Name='$esxcli'
  )

  # Write the current command to the output stream
  [string]::Join('.',$Name)

  # List all the properties recursive
  $EsxCli |
    Get-Member -MemberType CodeProperty |
    ForEach-Object {
      if ($_)
      {
        # Call this function recursive for a sublevel
        $SubLevel = $_.Name
        Get-EsxCliCommand -EsxCli $EsxCli.$SubLevel -Name ($Name + $SubLevel)
      }
    }

  # List all the methods
  $EsxCli |
    Get-Member -MemberType CodeMethod |
    ForEach-Object {
      if ($_)
      {
        # Write the method to the output stream
        $SubLevel = $_.Name
        [string]::Join('.',$Name) + '.' + $SubLevel + '(' + $_.Definition.Split('(')[1]
      }
    }
}
</pre>
<p>Listing 3. The PowerCLI Get-EsxCliCommand function that lists all the possible PowerCLI ESXCLI commands.</p>
<p>You can use the Get-EsxCliCommand function as is shown in the examples in the code.</p>
<h1>ESXCLI commands for vSphere 5</h1>
<p>If you run the &#8220;Get-EsxCliCommand -EsxCli $esxcli -Name &#8216;$esxcli&#8217;&#8221; command for a VMware vSphere 5 host it will give the following output:</p>
<pre class="brush: plain; title: ; notranslate">
$esxcli
$esxcli.esxcli
$esxcli.esxcli.command
$esxcli.esxcli.command.list()
$esxcli.fcoe
$esxcli.fcoe.adapter
$esxcli.fcoe.adapter.list()
$esxcli.fcoe.nic
$esxcli.fcoe.nic.disable(string nicname)
$esxcli.fcoe.nic.discover(string nicname)
$esxcli.fcoe.nic.list()
$esxcli.hardware
$esxcli.hardware.bootdevice
$esxcli.hardware.bootdevice.list()
$esxcli.hardware.clock
$esxcli.hardware.clock.get()
$esxcli.hardware.clock.set(long day, long hour, long min, long month, long sec, long year)
$esxcli.hardware.cpu
$esxcli.hardware.cpu.cpuid
$esxcli.hardware.cpu.cpuid.get(long cpu)
$esxcli.hardware.cpu.global
$esxcli.hardware.cpu.global.get()
$esxcli.hardware.cpu.global.set(boolean hyperthreading)
$esxcli.hardware.cpu.list()
$esxcli.hardware.memory
$esxcli.hardware.memory.get()
$esxcli.hardware.pci
$esxcli.hardware.pci.list()
$esxcli.hardware.platform
$esxcli.hardware.platform.get()
$esxcli.iscsi
$esxcli.iscsi.adapter
$esxcli.iscsi.adapter.auth
$esxcli.iscsi.adapter.auth.chap
$esxcli.iscsi.adapter.auth.chap.get(string adapter, string direction)
$esxcli.iscsi.adapter.auth.chap.set(string adapter, string authname, boolean default, string direction, string level, string secret)
$esxcli.iscsi.adapter.auth.help()
$esxcli.iscsi.adapter.capabilities
$esxcli.iscsi.adapter.capabilities.get(string adapter)
$esxcli.iscsi.adapter.discovery
$esxcli.iscsi.adapter.discovery.sendtarget
$esxcli.iscsi.adapter.discovery.sendtarget.auth
$esxcli.iscsi.adapter.discovery.sendtarget.auth.chap
$esxcli.iscsi.adapter.discovery.sendtarget.auth.chap.get(string adapter, string address, string direction)
$esxcli.iscsi.adapter.discovery.sendtarget.auth.chap.set(string adapter, string address, string authname, boolean default, string direction, boolean inherit, string level, string secret)
$esxcli.iscsi.adapter.discovery.sendtarget.auth.help()
$esxcli.iscsi.adapter.discovery.sendtarget.param
$esxcli.iscsi.adapter.discovery.sendtarget.param.get(string adapter, string address)
$esxcli.iscsi.adapter.discovery.sendtarget.param.set(string adapter, string address, boolean default, boolean inherit, string key, string value)
$esxcli.iscsi.adapter.discovery.sendtarget.add(string adapter, string address)
$esxcli.iscsi.adapter.discovery.sendtarget.list(string adapter)
$esxcli.iscsi.adapter.discovery.sendtarget.remove(string adapter, string address)
$esxcli.iscsi.adapter.discovery.statictarget
$esxcli.iscsi.adapter.discovery.statictarget.add(string adapter, string address, string name)
$esxcli.iscsi.adapter.discovery.statictarget.list(string adapter)
$esxcli.iscsi.adapter.discovery.statictarget.remove(string adapter, string address, string name)
$esxcli.iscsi.adapter.discovery.status
$esxcli.iscsi.adapter.discovery.status.get(string adapter)
$esxcli.iscsi.adapter.discovery.rediscover(string adapter)
$esxcli.iscsi.adapter.firmware
$esxcli.iscsi.adapter.firmware.get(string adapter, string file)
$esxcli.iscsi.adapter.firmware.set(string adapter, string file)
$esxcli.iscsi.adapter.param
$esxcli.iscsi.adapter.param.get(string adapter)
$esxcli.iscsi.adapter.param.set(string adapter, boolean default, string key, string value)
$esxcli.iscsi.adapter.target
$esxcli.iscsi.adapter.target.portal
$esxcli.iscsi.adapter.target.portal.auth
$esxcli.iscsi.adapter.target.portal.auth.chap
$esxcli.iscsi.adapter.target.portal.auth.chap.get(string adapter, string address, string direction, string method, string name)
$esxcli.iscsi.adapter.target.portal.auth.chap.set(string adapter, string address, string authname, boolean default, string direction, boolean inherit, string level, string name, string secret)
$esxcli.iscsi.adapter.target.portal.auth.help()
$esxcli.iscsi.adapter.target.portal.param
$esxcli.iscsi.adapter.target.portal.param.get(string adapter, string address, string name)
$esxcli.iscsi.adapter.target.portal.param.set(string adapter, string address, boolean default, boolean inherit, string key, string name, string value)
$esxcli.iscsi.adapter.target.portal.list(string adapter, string name)
$esxcli.iscsi.adapter.target.list(string adapter, string name)
$esxcli.iscsi.adapter.get(string adapter)
$esxcli.iscsi.adapter.list(string adapter)
$esxcli.iscsi.adapter.set(string adapter, string alias, string name)
$esxcli.iscsi.ibftboot
$esxcli.iscsi.ibftboot.get()
$esxcli.iscsi.ibftboot.import()
$esxcli.iscsi.logicalnetworkportal
$esxcli.iscsi.logicalnetworkportal.list(string adapter)
$esxcli.iscsi.networkportal
$esxcli.iscsi.networkportal.ipconfig
$esxcli.iscsi.networkportal.ipconfig.get(string adapter, string nic)
$esxcli.iscsi.networkportal.ipconfig.set(string adapter, string dns1, string dns2, string gateway, string ip, string nic, string subnet)
$esxcli.iscsi.networkportal.add(string adapter, boolean force, string nic)
$esxcli.iscsi.networkportal.list(string adapter)
$esxcli.iscsi.networkportal.remove(string adapter, boolean force, string nic)
$esxcli.iscsi.physicalnetworkportal
$esxcli.iscsi.physicalnetworkportal.param
$esxcli.iscsi.physicalnetworkportal.param.get(string adapter, string nic)
$esxcli.iscsi.physicalnetworkportal.param.set(string adapter, boolean enabled, string nic, string option)
$esxcli.iscsi.physicalnetworkportal.list(string adapter)
$esxcli.iscsi.plugin
$esxcli.iscsi.plugin.list(string adapter, string plugin)
$esxcli.iscsi.session
$esxcli.iscsi.session.connection
$esxcli.iscsi.session.connection.list(string adapter, string cid, string isid, string name)
$esxcli.iscsi.session.add(string adapter, string isid, string name)
$esxcli.iscsi.session.list(string adapter, string isid, string name)
$esxcli.iscsi.session.remove(string adapter, string isid, string name)
$esxcli.iscsi.software
$esxcli.iscsi.software.get()
$esxcli.iscsi.software.set(boolean enabled)
$esxcli.network
$esxcli.network.fence
$esxcli.network.fence.network
$esxcli.network.fence.network.bte
$esxcli.network.fence.network.bte.list(long fenceid, string vdsname)
$esxcli.network.fence.network.port
$esxcli.network.fence.network.port.list(long fenceid, string vdsname)
$esxcli.network.fence.network.list(long fenceid, string vdsname)
$esxcli.network.fence.list()
$esxcli.network.firewall
$esxcli.network.firewall.ruleset
$esxcli.network.firewall.ruleset.allowedip
$esxcli.network.firewall.ruleset.allowedip.add(string ipaddress, string rulesetid)
$esxcli.network.firewall.ruleset.allowedip.list(string rulesetid)
$esxcli.network.firewall.ruleset.allowedip.remove(string ipaddress, string rulesetid)
$esxcli.network.firewall.ruleset.rule
$esxcli.network.firewall.ruleset.rule.list(string rulesetid)
$esxcli.network.firewall.ruleset.list(string rulesetid)
$esxcli.network.firewall.ruleset.set(boolean allowedall, boolean enabled, string rulesetid)
$esxcli.network.firewall.get()
$esxcli.network.firewall.load()
$esxcli.network.firewall.refresh()
$esxcli.network.firewall.set(boolean defaultaction, boolean enabled)
$esxcli.network.firewall.unload()
$esxcli.network.ip
$esxcli.network.ip.connection
$esxcli.network.ip.connection.list(string type)
$esxcli.network.ip.dns
$esxcli.network.ip.dns.search
$esxcli.network.ip.dns.search.add(string domain)
$esxcli.network.ip.dns.search.list()
$esxcli.network.ip.dns.search.remove(string domain)
$esxcli.network.ip.dns.server
$esxcli.network.ip.dns.server.add(string server)
$esxcli.network.ip.dns.server.list()
$esxcli.network.ip.dns.server.remove(boolean all, string server)
$esxcli.network.ip.dns.help()
$esxcli.network.ip.interface
$esxcli.network.ip.interface.ipv4
$esxcli.network.ip.interface.ipv4.get(string interfacename)
$esxcli.network.ip.interface.ipv4.set(string interfacename, string ipv4, string netmask, boolean peerdns, string type)
$esxcli.network.ip.interface.ipv6
$esxcli.network.ip.interface.ipv6.address
$esxcli.network.ip.interface.ipv6.address.add(string interfacename, string ipv6)
$esxcli.network.ip.interface.ipv6.address.list()
$esxcli.network.ip.interface.ipv6.address.remove(string interfacename, string ipv6)
$esxcli.network.ip.interface.ipv6.get(string interfacename)
$esxcli.network.ip.interface.ipv6.set(boolean enabledhcpv6, boolean enablerouteradv, string interfacename, boolean peerdns)
$esxcli.network.ip.interface.add(string interfacename, string macaddress, long mtu, string portgroupname)
$esxcli.network.ip.interface.list()
$esxcli.network.ip.interface.remove(string interfacename)
$esxcli.network.ip.interface.set(boolean enabled, string interfacename, long mtu)
$esxcli.network.ip.neighbor
$esxcli.network.ip.neighbor.list(string version)
$esxcli.network.ip.get()
$esxcli.network.ip.set(boolean ipv6enabled)
$esxcli.network.nic
$esxcli.network.nic.down(string nicname)
$esxcli.network.nic.get(string nicname)
$esxcli.network.nic.list()
$esxcli.network.nic.set(boolean auto, string duplex, long messagelevel, string nicname, long phyaddress, string port, long speed, string transceivertype, string wakeonlan)
$esxcli.network.nic.up(string nicname)
$esxcli.network.vswitch
$esxcli.network.vswitch.dvs
$esxcli.network.vswitch.dvs.vmware
$esxcli.network.vswitch.dvs.vmware.list(string vdsname)
$esxcli.network.vswitch.dvs.help()
$esxcli.network.vswitch.standard
$esxcli.network.vswitch.standard.policy
$esxcli.network.vswitch.standard.policy.failover
$esxcli.network.vswitch.standard.policy.failover.get(string vswitchname)
$esxcli.network.vswitch.standard.policy.failover.set(string activeuplinks, boolean failback, string failuredetection, string loadbalancing, boolean notifyswitches, string standbyuplinks, string vswitchname)
$esxcli.network.vswitch.standard.policy.security
$esxcli.network.vswitch.standard.policy.security.get(string vswitchname)
$esxcli.network.vswitch.standard.policy.security.set(boolean allowforgedtransmits, boolean allowmacchange, boolean allowpromiscuous, string vswitchname)
$esxcli.network.vswitch.standard.policy.shaping
$esxcli.network.vswitch.standard.policy.shaping.get(string vswitchname)
$esxcli.network.vswitch.standard.policy.shaping.set(long avgbandwidth, long burstsize, boolean enabled, long peakbandwidth, string vswitchname)
$esxcli.network.vswitch.standard.policy.help()
$esxcli.network.vswitch.standard.portgroup
$esxcli.network.vswitch.standard.portgroup.policy
$esxcli.network.vswitch.standard.portgroup.policy.failover
$esxcli.network.vswitch.standard.portgroup.policy.failover.get(string portgroupname)
$esxcli.network.vswitch.standard.portgroup.policy.failover.set(string activeuplinks, boolean failback, string failuredetection, string loadbalancing, boolean notifyswitches, string portgroupname, string standbyuplinks, boolean usevswitch)
$esxcli.network.vswitch.standard.portgroup.policy.security
$esxcli.network.vswitch.standard.portgroup.policy.security.get(string portgroupname)
$esxcli.network.vswitch.standard.portgroup.policy.security.set(boolean allowforgedtransmits, boolean allowmacchange, boolean allowpromiscuous, string portgroupname, boolean usevswitch)
$esxcli.network.vswitch.standard.portgroup.policy.shaping
$esxcli.network.vswitch.standard.portgroup.policy.shaping.get(string portgroupname)
$esxcli.network.vswitch.standard.portgroup.policy.shaping.set(long avgbandwidth, long burstsize, boolean enabled, long peakbandwidth, string portgroupname, boolean usevswitch)
$esxcli.network.vswitch.standard.portgroup.policy.help()
$esxcli.network.vswitch.standard.portgroup.add(string portgroupname, string vswitchname)
$esxcli.network.vswitch.standard.portgroup.list()
$esxcli.network.vswitch.standard.portgroup.remove(string portgroupname, string vswitchname)
$esxcli.network.vswitch.standard.portgroup.set(string portgroupname, long vlanid)
$esxcli.network.vswitch.standard.uplink
$esxcli.network.vswitch.standard.uplink.add(string uplinkname, string vswitchname)
$esxcli.network.vswitch.standard.uplink.remove(string uplinkname, string vswitchname)
$esxcli.network.vswitch.standard.add(long ports, string vswitchname)
$esxcli.network.vswitch.standard.list(string vswitchname)
$esxcli.network.vswitch.standard.remove(string vswitchname)
$esxcli.network.vswitch.standard.set(string cdpstatus, long mtu, string vswitchname)
$esxcli.network.vswitch.help()
$esxcli.software
$esxcli.software.acceptance
$esxcli.software.acceptance.get()
$esxcli.software.acceptance.set(string level)
$esxcli.software.profile
$esxcli.software.profile.get(boolean rebootingimage)
$esxcli.software.profile.install(string[] depot, boolean dryrun, boolean force, boolean maintenancemode, boolean noliveinstall, boolean nosigcheck, boolean oktoremove, string profile, string proxy)
$esxcli.software.profile.update(boolean allowdowngrades, string[] depot, boolean dryrun, boolean force, boolean maintenancemode, boolean noliveinstall, boolean nosigcheck, string profile, string proxy)
$esxcli.software.profile.validate(string[] depot, string profile, string proxy)
$esxcli.software.sources
$esxcli.software.sources.profile
$esxcli.software.sources.profile.get(string[] depot, string profile, string proxy)
$esxcli.software.sources.profile.list(string[] depot, string proxy)
$esxcli.software.sources.vib
$esxcli.software.sources.vib.get(string[] depot, string proxy, string[] vibname, string[] viburl)
$esxcli.software.sources.vib.list(string[] depot, string proxy)
$esxcli.software.sources.help()
$esxcli.software.vib
$esxcli.software.vib.get(boolean rebootingimage, string[] vibname)
$esxcli.software.vib.install(string[] depot, boolean dryrun, boolean force, boolean maintenancemode, boolean noliveinstall, boolean nosigcheck, string proxy, string[] vibname, string[] viburl)
$esxcli.software.vib.list(boolean rebootingimage)
$esxcli.software.vib.remove(boolean dryrun, boolean force, boolean maintenancemode, boolean noliveinstall, string[] vibname)
$esxcli.software.vib.update(string[] depot, boolean dryrun, boolean force, boolean maintenancemode, boolean noliveinstall, boolean nosigcheck, string proxy, string[] vibname, string[] viburl)
$esxcli.storage
$esxcli.storage.core
$esxcli.storage.core.adapter
$esxcli.storage.core.adapter.stats
$esxcli.storage.core.adapter.stats.get(string adapter)
$esxcli.storage.core.adapter.list()
$esxcli.storage.core.adapter.rescan(string adapter, boolean all, boolean skipclaim, boolean skipfsscan, string type)
$esxcli.storage.core.claiming
$esxcli.storage.core.claiming.autoclaim(string claimruleclass, boolean enabled, boolean wait)
$esxcli.storage.core.claiming.reclaim(string device)
$esxcli.storage.core.claiming.unclaim(string adapter, long channel, string claimruleclass, string device, string driver, long lun, string model, string path, string plugin, long target, string type, string vendor)
$esxcli.storage.core.claimrule
$esxcli.storage.core.claimrule.add(string adapter, boolean autoassign, long channel, string claimruleclass, string device, string driver, boolean force, string ifunset, string iqn, long lun, string model, string plugin, long rule, long target, string transport, string type, string vendor, string wwnn, string wwpn)
$esxcli.storage.core.claimrule.convert(boolean commit)
$esxcli.storage.core.claimrule.list(string claimruleclass)
$esxcli.storage.core.claimrule.load(string claimruleclass)
$esxcli.storage.core.claimrule.move(string claimruleclass, long newrule, long rule)
$esxcli.storage.core.claimrule.remove(string claimruleclass, string plugin, long rule)
$esxcli.storage.core.claimrule.run(string adapter, long channel, string claimruleclass, string device, long lun, string path, long target, string type, boolean wait)
$esxcli.storage.core.device
$esxcli.storage.core.device.detached
$esxcli.storage.core.device.detached.list(string device)
$esxcli.storage.core.device.detached.remove(string device)
$esxcli.storage.core.device.partition
$esxcli.storage.core.device.partition.list(string device)
$esxcli.storage.core.device.stats
$esxcli.storage.core.device.stats.get(string device)
$esxcli.storage.core.device.vaai
$esxcli.storage.core.device.vaai.status
$esxcli.storage.core.device.vaai.status.get(string device)
$esxcli.storage.core.device.vaai.help()
$esxcli.storage.core.device.world
$esxcli.storage.core.device.world.list(string device)
$esxcli.storage.core.device.list(string device)
$esxcli.storage.core.device.set(string device, string name, boolean nopersist, string state)
$esxcli.storage.core.device.setconfig(boolean detached, string device, boolean perenniallyreserved)
$esxcli.storage.core.path
$esxcli.storage.core.path.stats
$esxcli.storage.core.path.stats.get(string path)
$esxcli.storage.core.path.list(string device, string path)
$esxcli.storage.core.path.set(string path, string state)
$esxcli.storage.core.plugin
$esxcli.storage.core.plugin.registration
$esxcli.storage.core.plugin.registration.add(string dependencies, string fullpath, string modulename, string pluginclass, string pluginname)
$esxcli.storage.core.plugin.registration.list(string modulename, string pluginclass)
$esxcli.storage.core.plugin.registration.remove(string modulename)
$esxcli.storage.core.plugin.list(string pluginclass)
$esxcli.storage.core.help()
$esxcli.storage.filesystem
$esxcli.storage.filesystem.automount()
$esxcli.storage.filesystem.list()
$esxcli.storage.filesystem.mount(boolean nopersist, string volumelabel, string volumeuuid)
$esxcli.storage.filesystem.rescan()
$esxcli.storage.filesystem.unmount(boolean nopersist, string volumelabel, string volumepath, string volumeuuid)
$esxcli.storage.nfs
$esxcli.storage.nfs.add(string host, boolean readonly, string share, string volumename)
$esxcli.storage.nfs.list()
$esxcli.storage.nfs.remove(string volumename)
$esxcli.storage.nmp
$esxcli.storage.nmp.device
$esxcli.storage.nmp.device.list(string device)
$esxcli.storage.nmp.device.set(boolean default, string device, string psp)
$esxcli.storage.nmp.path
$esxcli.storage.nmp.path.list(string device, string path)
$esxcli.storage.nmp.psp
$esxcli.storage.nmp.psp.fixed
$esxcli.storage.nmp.psp.fixed.deviceconfig
$esxcli.storage.nmp.psp.fixed.deviceconfig.get(string device)
$esxcli.storage.nmp.psp.fixed.deviceconfig.set(boolean default, string device, string path)
$esxcli.storage.nmp.psp.fixed.help()
$esxcli.storage.nmp.psp.generic
$esxcli.storage.nmp.psp.generic.deviceconfig
$esxcli.storage.nmp.psp.generic.deviceconfig.get(string device)
$esxcli.storage.nmp.psp.generic.deviceconfig.set(string config, string device)
$esxcli.storage.nmp.psp.generic.pathconfig
$esxcli.storage.nmp.psp.generic.pathconfig.get(string path)
$esxcli.storage.nmp.psp.generic.pathconfig.set(string config, string path)
$esxcli.storage.nmp.psp.generic.help()
$esxcli.storage.nmp.psp.roundrobin
$esxcli.storage.nmp.psp.roundrobin.deviceconfig
$esxcli.storage.nmp.psp.roundrobin.deviceconfig.get(string device)
$esxcli.storage.nmp.psp.roundrobin.deviceconfig.set(long bytes, string device, long iops, string type, boolean useano)
$esxcli.storage.nmp.psp.roundrobin.help()
$esxcli.storage.nmp.psp.list()
$esxcli.storage.nmp.satp
$esxcli.storage.nmp.satp.generic
$esxcli.storage.nmp.satp.generic.deviceconfig
$esxcli.storage.nmp.satp.generic.deviceconfig.get(string device)
$esxcli.storage.nmp.satp.generic.deviceconfig.set(string config, string device)
$esxcli.storage.nmp.satp.generic.pathconfig
$esxcli.storage.nmp.satp.generic.pathconfig.get(string path)
$esxcli.storage.nmp.satp.generic.pathconfig.set(string config, string path)
$esxcli.storage.nmp.satp.generic.help()
$esxcli.storage.nmp.satp.rule
$esxcli.storage.nmp.satp.rule.add(boolean boot, string claimoption, string description, string device, string driver, boolean force, string model, string option, string psp, string pspoption, string satp, string transport, string type, string vendor)
$esxcli.storage.nmp.satp.rule.list(string satp)
$esxcli.storage.nmp.satp.rule.remove(boolean boot, string claimoption, string description, string device, string driver, string model, string option, string psp, string pspoption, string satp, string transport, string type, string vendor)
$esxcli.storage.nmp.satp.list()
$esxcli.storage.nmp.satp.set(boolean boot, string defaultpsp, string satp)
$esxcli.storage.nmp.help()
$esxcli.storage.vmfs
$esxcli.storage.vmfs.extent
$esxcli.storage.vmfs.extent.list()
$esxcli.storage.vmfs.snapshot
$esxcli.storage.vmfs.snapshot.extent
$esxcli.storage.vmfs.snapshot.extent.list(string volumelabel, string volumeuuid)
$esxcli.storage.vmfs.snapshot.list(string volumelabel, string volumeuuid)
$esxcli.storage.vmfs.snapshot.mount(boolean nopersist, string volumelabel, string volumeuuid)
$esxcli.storage.vmfs.snapshot.resignature(string volumelabel, string volumeuuid)
$esxcli.storage.vmfs.upgrade(string volumelabel, string volumeuuid)
$esxcli.system
$esxcli.system.boot
$esxcli.system.boot.device
$esxcli.system.boot.device.get()
$esxcli.system.boot.help()
$esxcli.system.coredump
$esxcli.system.coredump.network
$esxcli.system.coredump.network.get()
$esxcli.system.coredump.network.set(boolean enable, string interfacename, string serveripv4, long serverport)
$esxcli.system.coredump.partition
$esxcli.system.coredump.partition.get()
$esxcli.system.coredump.partition.list()
$esxcli.system.coredump.partition.set(boolean enable, string partition, boolean smart, boolean unconfigure)
$esxcli.system.coredump.help()
$esxcli.system.hostname
$esxcli.system.hostname.get()
$esxcli.system.hostname.set(string domain, string fqdn, string host)
$esxcli.system.module
$esxcli.system.module.parameters
$esxcli.system.module.parameters.list(string module)
$esxcli.system.module.parameters.set(boolean force, string module, string parameterstring)
$esxcli.system.module.get(string module)
$esxcli.system.module.list(boolean enabled, boolean loaded)
$esxcli.system.module.load(boolean force, string module)
$esxcli.system.module.set(boolean enabled, boolean force, string module)
$esxcli.system.process
$esxcli.system.process.stats
$esxcli.system.process.stats.load
$esxcli.system.process.stats.load.get()
$esxcli.system.process.stats.running
$esxcli.system.process.stats.running.get()
$esxcli.system.process.stats.help()
$esxcli.system.process.list()
$esxcli.system.secpolicy
$esxcli.system.secpolicy.domain
$esxcli.system.secpolicy.domain.list()
$esxcli.system.secpolicy.domain.set(boolean alldomains, string level, string name)
$esxcli.system.secpolicy.help()
$esxcli.system.settings
$esxcli.system.settings.advanced
$esxcli.system.settings.advanced.list(string option, string tree)
$esxcli.system.settings.advanced.set(boolean default, long intvalue, string option, string stringvalue)
$esxcli.system.settings.kernel
$esxcli.system.settings.kernel.list(string option)
$esxcli.system.settings.kernel.set(string setting, string value)
$esxcli.system.settings.keyboard
$esxcli.system.settings.keyboard.layout
$esxcli.system.settings.keyboard.layout.get()
$esxcli.system.settings.keyboard.layout.list()
$esxcli.system.settings.keyboard.layout.set(string layout, boolean nopersist)
$esxcli.system.settings.keyboard.help()
$esxcli.system.settings.help()
$esxcli.system.stats
$esxcli.system.stats.uptime
$esxcli.system.stats.uptime.get()
$esxcli.system.stats.help()
$esxcli.system.syslog
$esxcli.system.syslog.config
$esxcli.system.syslog.config.logger
$esxcli.system.syslog.config.logger.list()
$esxcli.system.syslog.config.logger.set(string id, string reset, long rotate, long size)
$esxcli.system.syslog.config.get()
$esxcli.system.syslog.config.set(long defaultrotate, long defaultsize, string logdir, boolean logdirunique, string loghost, string reset)
$esxcli.system.syslog.mark(string message)
$esxcli.system.syslog.reload()
$esxcli.system.time
$esxcli.system.time.get()
$esxcli.system.time.set(long day, long hour, long min, long month, long sec, long year)
$esxcli.system.uuid
$esxcli.system.uuid.get()
$esxcli.system.version
$esxcli.system.version.get()
$esxcli.system.visorfs
$esxcli.system.visorfs.ramdisk
$esxcli.system.visorfs.ramdisk.add(long maxsize, long minsize, string name, string permissions, string target)
$esxcli.system.visorfs.ramdisk.list()
$esxcli.system.visorfs.ramdisk.remove(string target)
$esxcli.system.visorfs.tardisk
$esxcli.system.visorfs.tardisk.list()
$esxcli.system.visorfs.get()
$esxcli.system.welcomemsg
$esxcli.system.welcomemsg.get()
$esxcli.system.welcomemsg.set(string message)
$esxcli.vm
$esxcli.vm.process
$esxcli.vm.process.kill(string type, long worldid)
$esxcli.vm.process.list()
</pre>
<p>Listing 4. PowerCLI ESXCLI commands for a VMware vSphere 5.0 host.</p>
<h1>ESXCLI commands for vSphere 4</h1>
<p>The ESXCLI commands have changed much between vSphere 4 and vSphere 5. Because a lot of organizations still use vSphere 4, I also provide the vSphere 4 PowerCLI ESXCLI commands.</p>
<pre class="brush: plain; title: ; notranslate">
$esxcli
$esxcli.corestorage
$esxcli.corestorage.claiming
$esxcli.corestorage.claiming.autoclaim(string claimruleclass, boolean enabled)
$esxcli.corestorage.claiming.reclaim(string device)
$esxcli.corestorage.claiming.unclaim(string adapter, long channel, string claimruleclass, string device, string driver, long lun, string model, string path, string plugin, long target, string type, string vendor)
$esxcli.corestorage.claimrule
$esxcli.corestorage.claimrule.add(string adapter, boolean autoassign, long channel, string claimruleclass, string device, string driver, boolean force, long lun, string model, string plugin, long rule, long target, string transport, string type, string vendor)
$esxcli.corestorage.claimrule.convert(boolean commit)
$esxcli.corestorage.claimrule.delete(string claimruleclass, long rule)
$esxcli.corestorage.claimrule.list(string claimruleclass)
$esxcli.corestorage.claimrule.load(string claimruleclass)
$esxcli.corestorage.claimrule.move(string claimruleclass, long newrule, long rule)
$esxcli.corestorage.claimrule.run(string adapter, long channel, string claimruleclass, string device, long lun, string path, long target, string type, boolean wait)
$esxcli.corestorage.device
$esxcli.corestorage.device.list(string device)
$esxcli.corestorage.plugin
$esxcli.corestorage.plugin.list(string pluginclass)
$esxcli.network
$esxcli.network.connection
$esxcli.network.connection.list(string type)
$esxcli.network.neighbor
$esxcli.network.neighbor.list(string version)
$esxcli.nmp
$esxcli.nmp.boot
$esxcli.nmp.boot.restore()
$esxcli.nmp.device
$esxcli.nmp.device.list(string device)
$esxcli.nmp.device.setpolicy(boolean default, string device, string psp)
$esxcli.nmp.fixed
$esxcli.nmp.fixed.getpreferred(string device)
$esxcli.nmp.fixed.setpreferred(boolean default, string device, string path)
$esxcli.nmp.path
$esxcli.nmp.path.list(string device, string path)
$esxcli.nmp.psp
$esxcli.nmp.psp.getconfig(string device, string path)
$esxcli.nmp.psp.list()
$esxcli.nmp.psp.setconfig(string config, string device, string path)
$esxcli.nmp.roundrobin
$esxcli.nmp.roundrobin.getconfig(string device)
$esxcli.nmp.roundrobin.setconfig(long bytes, string device, long iops, string type, boolean useANO)
$esxcli.nmp.satp
$esxcli.nmp.satp.addrule(string claimoption, string description, string device, string driver, boolean force, string model, string option, string psp, string pspoption, string satp, string transport, string vendor)
$esxcli.nmp.satp.deleterule(string claimoption, string description, string device, string driver, string model, string option, string psp, string pspoption, string satp, string transport, string vendor)
$esxcli.nmp.satp.getconfig(string device, string path)
$esxcli.nmp.satp.list()
$esxcli.nmp.satp.listrules(string satp)
$esxcli.nmp.satp.setconfig(string config, string device, string path)
$esxcli.nmp.satp.setdefaultpsp(string psp, string satp)
$esxcli.swiscsi
$esxcli.swiscsi.nic
$esxcli.swiscsi.nic.add(string adapter, string nic)
$esxcli.swiscsi.nic.list(string adapter)
$esxcli.swiscsi.nic.remove(string adapter, string nic)
$esxcli.swiscsi.session
$esxcli.swiscsi.session.add(string adapter, string isid, string target)
$esxcli.swiscsi.session.list(string adapter, string target)
$esxcli.swiscsi.session.remove(string adapter, string isid, string target)
$esxcli.swiscsi.vmknic
$esxcli.swiscsi.vmknic.list(string adapter)
$esxcli.swiscsi.vmnic
$esxcli.swiscsi.vmnic.list(string adapter)
$esxcli.vaai
$esxcli.vaai.device
$esxcli.vaai.device.list(string device)
$esxcli.vms
$esxcli.vms.vm
$esxcli.vms.vm.kill(string type, long worldid)
$esxcli.vms.vm.list()
</pre>
<p>Listing 5. PowerCLI ESXCLI commands for a VMware vSphere 4.1 host.</p>
<h1>Using help</h1>
<p>Something that is not clear from listing 4 and 5 is that a lot of the esxcli commands provide help. E.g. I could type the command &#8220;$esxcli.storage.vmfs.snapshot.help()&#8221; and get the following output:</p>
<pre class="brush: plain; title: ; notranslate">
=========================================================================
vim.EsxCLI.storage.vmfs.snapshot
-------------------------------------------------------------------------
Manage VMFS snapshots.

ChildElement
-------------------------------------------------------------------------
- storage.vmfs.snaps | Manage VMFS snapshot extents.
  hot.extent         |

Method
-------------------------------------------------------------------------
- list               | List unresolved snapshots/replicas of VMFS volume.
- mount              | Mount a snapshot/replica of a VMFS volume.
- resignature        | Resignature a snapshot/replica of a VMFS volume.
</pre>
<p>Listing 6. Help of the $esxcli.storage.vmfs.snapshot command.</p>
<p>You will not see all the help commands in listing 4 and 5 because most help methods are of membertype Method and the function only shows methods of membertype CodeMethod. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/695/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/695/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=695&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2012/08/19/how-to-list-all-the-powercli-esxcli-commands/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif" medium="image">
			<media:title type="html">PowerCLI-logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Use Performance Monitor to get VM performance statistics</title>
		<link>http://rvdnieuwendijk.com/2012/06/19/use-performance-monitor-to-get-vm-performance-statistics/</link>
		<comments>http://rvdnieuwendijk.com/2012/06/19/use-performance-monitor-to-get-vm-performance-statistics/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 16:47:59 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[Counters]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Get-Counter]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Monitor]]></category>
		<category><![CDATA[perfmon]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[virtual machine]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=530</guid>
		<description><![CDATA[In PowerCLI you can use the Get-Stat cmdlet to get performance statistics. But for Microsoft Windows virtual machines with the VMware Tools installed there is another way to get the statistics. Even without using PowerCLI. Performance Monitor The VMware Tools for a Microsoft Windows computer adds VMware specific counters to the Performance Monitor. The counters are [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=530&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png"><img class="alignleft size-full wp-image-127" title="PowerShell-logo" src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png?w=630" alt="PowerShell logo"   /></a>In PowerCLI you can use the Get-Stat cmdlet to get performance statistics. But for Microsoft Windows virtual machines with the VMware Tools installed there is another way to get the statistics. Even without using PowerCLI.<span id="more-530"></span></p>
<h3>Performance Monitor</h3>
<p>The VMware Tools for a Microsoft Windows computer adds VMware specific counters to the Performance Monitor. The counters are in two categories: &#8220;VM Memory&#8221; and &#8220;VM Processor&#8221;. These categories contain the following counters (vSphere 4.1):</p>
<p><strong>VM Memory</strong></p>
<ul>
<li>Memory Active in MB</li>
<li>Memory Ballooned in MB</li>
<li>Memory Limit in MB</li>
<li>Memory Mapped in MB</li>
<li>Memory Overhead in MB</li>
<li>Memory Reservation in MB</li>
<li>Memory Shared in MB</li>
<li>Memory Shared Saved in MB</li>
<li>Memory Shares</li>
<li>Memory Swapped in MB</li>
<li>Memory Target Size</li>
<li>Memory Used in MB</li>
</ul>
<p><strong>VM Processor</strong></p>
<ul>
<li>% Processor Time</li>
<li>CPU stolen time</li>
<li>Effective VM Speed in MHz</li>
<li>Host processor speed in MHz</li>
<li>Limit in MHz</li>
<li>Reservation in MHz</li>
<li>Shares</li>
</ul>
<p>In figure 1 you see some of the VMware counters in the Performance Monitor Add Counters window.</p>
<p><a href="http://rvdnieuwendijk.files.wordpress.com/2012/06/performance-monitor-add-counters2.jpg"><img class="aligncenter size-full wp-image-644" title="Performance Monitor Add Counters" src="http://rvdnieuwendijk.files.wordpress.com/2012/06/performance-monitor-add-counters2.jpg?w=630&#038;h=463" alt="" width="630" height="463" /></a><br />
Figure 1. Performance Monitor Add Counters window.</p>
<p>After adding these counters you can see them in action in figure 2.</p>
<p><a href="http://rvdnieuwendijk.files.wordpress.com/2012/06/performance-monitor.jpg"><img class="aligncenter size-full wp-image-621" title="Performance Monitor VMware Counters" src="http://rvdnieuwendijk.files.wordpress.com/2012/06/performance-monitor.jpg?w=630&#038;h=574" alt="" width="630" height="574" /></a><br />
Figure 2. Performance Monitor VMware counters in action.</p>
<h3>The PowerShell Get-Counter cmdlet</h3>
<p>The PowerShell <a href="http://technet.microsoft.com/en-us/library/hh849685.aspx">Get-Counter</a> cmdlet gets performance counter data from local and remote computers. The PowerShell script of listing 1 shows all the VMware performance counters for a server.</p>
<pre class="brush: powershell; title: ; notranslate">
$ComputerName = &quot;server01&quot;
Get-Counter -ComputerName $ComputerName -ListSet VM* |
Select-Object -Expandproperty Counter
</pre>
<p> Listing 1. PowerShell script to get all VMware counters for server Server01.</p>
<p>Sample output of this script is shown in output 1.</p>
<pre class="brush: plain; title: ; notranslate">
\\server01\VM Processor(*)\Limit in MHz
\\server01\VM Processor(*)\Reservation in MHz
\\server01\VM Processor(*)\Shares
\\server01\VM Processor(*)\CPU stolen time
\\server01\VM Processor(*)\% Processor Time
\\server01\VM Processor(*)\Effective VM Speed in MHz
\\server01\VM Processor(*)\Host processor speed in MHz
\\server01\VM Memory\Memory Active in MB
\\server01\VM Memory\Memory Ballooned in MB
\\server01\VM Memory\Memory Limit in MB
\\server01\VM Memory\Memory Mapped in MB
\\server01\VM Memory\Memory Overhead in MB
\\server01\VM Memory\Memory Reservation in MB
\\server01\VM Memory\Memory Shared in MB
\\server01\VM Memory\Memory Shared Saved in MB
\\server01\VM Memory\Memory Shares
\\server01\VM Memory\Memory Swapped in MB
\\server01\VM Memory\Memory Target Size
\\server01\VM Memory\Memory Used in MB
</pre>
<p> Output 1. Sample output of the script of listing 1.</p>
<p>The PowerShell script of listing 2 will list not only the VMware counters, but it will list all the Performance Monitor counters for server Server01.</p>
<pre class="brush: powershell; title: ; notranslate">
$ComputerName = &quot;server01&quot;
Get-Counter -ComputerName $ComputerName -ListSet * |
Select -Expandproperty Counter
</pre>
<p> Listing 2. PowerShell script to get all Performance Monitor counters for server Server01.</p>
<p>The PowerShell script of listing 3 gets all VMware counters for server Server01, and retrieves the counter values, ten times with a two second interval. A sample output of this script for one interval is shown in output 2.</p>
<pre class="brush: powershell; title: ; notranslate">
$ComputerName = &quot;Server01&quot;
Get-Counter -ComputerName $ComputerName -ListSet VM* |
  Get-Counter -MaxSamples 10 -SampleInterval 2
</pre>
<p> Listing 3. PowerShell script to get all VMware counter values for server Server01.</p>
<h3>Annotations</h3>
<p><strong>Line 2</strong>: Get all the VMware counters.</p>
<p><strong>Line 3</strong>: Get the values for all the VMware counters, 10 times with a 2 seconds interval.</p>
<p>Output 2 shows the output of the script of listing 3 for one interval.</p>
<pre class="brush: plain; title: ; notranslate">
Timestamp                 CounterSamples
---------                 --------------
2012-06-19 18:11:20       \\server01\vm processor(_total)\limit in mhz :
                          4294967295

                          \\server01\vm processor(_total)\reservation in mhz :
                          0

                          \\server01\vm processor(_total)\shares :
                          2000

                          \\server01\vm processor(_total)\cpu stolen time :
                          5E-06

                          \\server01\vm processor(_total)\% processor time :
                          16.25

                          \\server01\vm processor(_total)\effective vm speed in mhz :
                          400

                          \\server01\vm processor(_total)\host processor speed in mhz :
                          2800

                          \\server01\vm memory\memory active in mb :
                          491

                          \\server01\vm memory\memory ballooned in mb :
                          0

                          \\server01\vm memory\memory limit in mb :
                          4294967295

                          \\server01\vm memory\memory mapped in mb :
                          3054

                          \\server01\vm memory\memory overhead in mb :
                          122

                          \\server01\vm memory\memory reservation in mb :
                          0

                          \\server01\vm memory\memory shared in mb :
                          22

                          \\server01\vm memory\memory shared saved in mb :
                          21

                          \\server01\vm memory\memory shares :
                          30720

                          \\server01\vm memory\memory swapped in mb :
                          17

                          \\server01\vm memory\memory target size :
                          3050

                          \\server01\vm memory\memory used in mb :
                          3033
</pre>
<p>Output 2. Sample output of the script of listing 3 for one interval.</p>
<h3>Export the output to a .csv file</h3>
<p>You can use the PowerShell <a href="http://technet.microsoft.com/en-us/library/dd367895.aspx">Export-Counter</a> cmdlet to export performance counter data to log files in binary performance log (.blg), comma-separated value (.csv), or tab-separated value (.tsv) format.</p>
<p>Listing 4 shows you how to use the Export-Counter cmdlet to export to a .csv file. You can use this .csv file for further analysis of the counters in a spreadsheet. Or to import them in another PowerShell script.</p>
<pre class="brush: powershell; title: ; notranslate">
$ComputerName = &quot;server01&quot;
$Path = &quot;vSphereCounters.csv&quot;
Get-Counter -ComputerName $ComputerName -ListSet VM* |
  Get-Counter -MaxSamples 10 -SampleInterval 2 |
  Export-Counter -Path $Path -FileFormat Csv -Force 
</pre>
<p> Listing 4. PowerShell script to get all VMware counters for server Server01 and export them to vSphereCounters.csv.</p>
<p>When you open the vSphereCounters.csv file in Excel, the output will look like output 3. Every counter has its own column.</p>
<p><a href="http://rvdnieuwendijk.files.wordpress.com/2012/06/export-counters-output.png"><img src="http://rvdnieuwendijk.files.wordpress.com/2012/06/export-counters-output.png?w=630&#038;h=229" alt="Output of the Export-Counter cmdlet imported in Excel" title="Export-Counters output" width="630" height="229" class="aligncenter size-full wp-image-648" /></a><br />
Output 3. Output of the Export-Counter cmdlet imported in Excel.</p>
<h3>Conclusion</h3>
<p>The VMware Tools adds performance counters to the Windows Performance Monitor. You can use The PowerShell Get-Counter and Export-Counter cmdlets to retrieve the counter values.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/530/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=530&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2012/06/19/use-performance-monitor-to-get-vm-performance-statistics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png" medium="image">
			<media:title type="html">PowerShell-logo</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2012/06/performance-monitor-add-counters2.jpg" medium="image">
			<media:title type="html">Performance Monitor Add Counters</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2012/06/performance-monitor.jpg" medium="image">
			<media:title type="html">Performance Monitor VMware Counters</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2012/06/export-counters-output.png" medium="image">
			<media:title type="html">Export-Counters output</media:title>
		</media:content>
	</item>
		<item>
		<title>Use PowerCLI to find the datastore from a disk name</title>
		<link>http://rvdnieuwendijk.com/2012/06/03/use-powercli-to-find-the-datastore-from-a-disk-name/</link>
		<comments>http://rvdnieuwendijk.com/2012/06/03/use-powercli-to-find-the-datastore-from-a-disk-name/#comments</comments>
		<pubDate>Sun, 03 Jun 2012 08:26:12 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[advanced function]]></category>
		<category><![CDATA[datastore]]></category>
		<category><![CDATA[disk partitions]]></category>
		<category><![CDATA[DiskName]]></category>
		<category><![CDATA[Get-View]]></category>
		<category><![CDATA[host error]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=532</guid>
		<description><![CDATA[Recently we get vSphere alarms in our environment that say for instance: &#8220;[VMware vCenter - Alarm Host error] Issue detected on host in datastore: ScsiDeviceIO: 2368: Failed write command to write-quiesced partition naa.600a0b8000111155000021c53f97784e:1 (42:01:04:07.994 cpu7:5191)&#8221; There seems to be a problem on a partition. But which datastore is on this partition? We can use PowerCLI [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=532&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif"><img src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif?w=630" alt="PowerCLI logo" title="PowerCLI-logo"   class="alignleft size-full wp-image-68" /></a>Recently we get vSphere alarms in our environment that say for instance:</p>
<p>&#8220;[VMware vCenter - Alarm Host error] Issue detected on host in datastore: ScsiDeviceIO: 2368: Failed write command to write-quiesced partition naa.600a0b8000111155000021c53f97784e:1 (42:01:04:07.994 cpu7:5191)&#8221;</p>
<p>There seems to be a problem on a partition. But which datastore is on this partition? We can use PowerCLI to find the datastore involved.<span id="more-532"></span></p>
<h3>List all datastores and disk names</h3>
<p>We can use the PowerCLI script from listing 1 to list all datastores and the disk names of the partitions.</p>
<pre class="brush: powershell; title: ; notranslate">
Get-Datastore |
Where-Object {$_.ExtensionData.Info.GetType().Name -eq &quot;VmfsDatastoreInfo&quot;} |
ForEach-Object {
  if ($_)
  {
    $Datastore = $_
    $Datastore.ExtensionData.Info.Vmfs.Extent |
    Select-Object -Property @{Name=&quot;Name&quot;;Expression={$Datastore.Name}},
      DiskName
  }
}</pre>
<p>Listing 1. PowerCLI script to list all datastores and the disk names of the partitions.</p>
<p>A sample output of this script is:</p>
<pre class="brush: plain; title: ; notranslate">
Name                        DiskName
----                        --------
esxi01_boot                 naa.600a0b80001111550000fb9cf54f414d
esxi02_boot                 naa.600a0b80001111550000850e884f414d
cluster01_gold_001          naa.600a0b80001111550000778bc952494d
cluster01_silver_001        naa.600a0b8000111155000074088c52494d
cluster01_bronze_003        naa.600a0b80001111550000e451a8ed794e
esxi03_boot                 naa.600508b4001078340000e00004c00000
esxi04_boot                 naa.600508b4001078340000e00002c60000
cluster02_gold_001          naa.600508b400055c680000800000dc0000
cluster02_silver_001        naa.600508b4001078340000e00004bb0000
cluster02_bronze_001        naa.600508b4001078340000e00002cb0000
</pre>
<p> Output 1. Sample output from the PowerCLI script from listing 1.</p>
<p>Of course you can try to find the diskname and the corresponding datastore in the list. But if the list is long this is not easy.</p>
<p>A better way is to let PowerCLI do the search.</p>
<h3>Find a specific datastore</h3>
<p>The PowerCLI from listing 2 shows returns only the datastore that contains the partition with the requested disk name.</p>
<pre class="brush: powershell; title: ; notranslate">
Get-Datastore |
Where-Object {$_.ExtensionData.Info.GetType().Name -eq &quot;VmfsDatastoreInfo&quot;} |
ForEach-Object {
  if ($_)
  {
    $Datastore = $_
    $Datastore.ExtensionData.Info.Vmfs.Extent |
      Where-Object {$_.DiskName -eq &quot;naa.600a0b80001111550000fb9cf54f414d&quot;} |
      ForEach-Object {
        if ($_)
        {
          $Datastore
        }
      }
  }
}</pre>
<p> Listing 2. PowerCLI script to get the datastore that contains the partion with the requested disk name.</p>
<p>Unfortunately the script from listing 2 is slow. In our environment with 138 datastores the script takes 43 seconds to run.</p>
<h3>A faster script</h3>
<p>I decided to make a PowerCLI advanced function that searches for the datastore as fast as possible. It uses the PowerCLI Get-View cmdlet to retrieve all the datastores. It then tries to match the datastores in this list with the given disk name.</p>
<pre class="brush: powershell; title: ; notranslate">
function Get-DatastoreByDiskName {
  &lt;#
  .SYNOPSIS
    Retrieves the datastore for a given disk name.
	
  .DESCRIPTION
    Retrieves the datastore for a given disk name.
	
  .PARAMETER DiskName
    Specify the disk name of the partition in the datastore to search for.
	
  .EXAMPLE
    Get-DatastoreByDiskName -DiskName naa.600a0b80001111550000a3fdfb4e6c4f
    Retrieves the datastore with disk name naa.600a0b80001111550000a3fdfb4e6c4f.
	
  .EXAMPLE
    &quot;naa.600a0b800011115500006852e34d6c4f&quot; | Get-DatastoreByDiskName
    Retrieves the datastore with disk name naa.600a0b800011115500006852e34d6c4f.
	
  .COMPONENT
    VMware vSphere PowerCLI

  .INPUTS
    String
	
  .OUTPUTS
    VmfsDatastoreImpl

  .NOTES
    Author:  Robert van den Nieuwendijk
    Date:    1-6-2012
    Version: 1.0

  .LINK

http://rvdnieuwendijk.com/


http://twitter.com/rvdnieuwendijk

  #&gt;
  
  [CmdletBinding()]
  param(
    [parameter(Mandatory = $true,
               ValueFromPipeline = $true,
               ValueFromPipelineByPropertyName = $true)]
    [string[]] $DiskName
  )
  
  begin {	
    # Get all the datastores
    $DatastoresView = Get-View -ViewType Datastore -Property Name,Info
  }
  
  process {
    ForEach ($Datastore in $DatastoresView)
    {
      # Only objects of type VMware.Vim.DatastoreInfo.VmfsDatastoreInfo
      # have the Info.Vmfs property
      if ($Datastore.Info.GetType().Name -eq &quot;VmfsDatastoreInfo&quot;)
      {
        ForEach ($Disk in $DiskName)
        {
          $Datastore.Info.Vmfs.Extent |
            ForEach-Object {
              if ($_ -and $_.Diskname -eq $Disk)
              {
                # Return the found datastore
                $Datastore | Get-VIObjectByVIView 
              }
            }
        }
      }
    }
  }
}
</pre>
<p> Listing 3. A PowerCLI advanced function that searches for the datastore as fast as possible.</p>
<p>This script finds one datastore in 1.5 seconds. That is 29 times faster than the script from listing 2.</p>
<p>You can use the advanced function to search for multiple datastores at once. Every extra datastore took me 1.1 seconds extra.</p>
<h3>Annotations</h3>
<p><strong>Line 50</strong>: Get all the datastores.</p>
<p><strong>Line 54-72</strong>: Loop through all the datastores.</p>
<p><strong>Line 60-70</strong>: Loop through all the disk names.</p>
<p><strong>Line 67</strong>: Return the found datastore.</p>
<h3>Conclusion</h3>
<p>We have not solved the issue from our vCenter alarm yet. But it least we now know which datastores are involved.</p>
<p>Writing PowerCLI code for maximum speed can make your code significantly faster.</p>
<p><strong><span style="background-color:#ffff00;">Update Januari 2nd, 2013</span></strong>: Thanks to reader Brad S. who commented on a problem that was in the original script of listing 1, I could solve the bug in this script. I updated the scripts in listing 1 and listing 2 to work correctly with datastores that have multiple extents.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/532/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=532&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2012/06/03/use-powercli-to-find-the-datastore-from-a-disk-name/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powercli-logo.gif" medium="image">
			<media:title type="html">PowerCLI-logo</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerShell function to get disk SCSI Lun number</title>
		<link>http://rvdnieuwendijk.com/2012/05/29/powershell-function-to-get-disk-scsi-lun-number/</link>
		<comments>http://rvdnieuwendijk.com/2012/05/29/powershell-function-to-get-disk-scsi-lun-number/#comments</comments>
		<pubDate>Tue, 29 May 2012 19:01:46 +0000</pubDate>
		<dc:creator>Robert van den Nieuwendijk</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Disk]]></category>
		<category><![CDATA[Lun]]></category>
		<category><![CDATA[SCSI]]></category>
		<category><![CDATA[Win32_DiskDrive]]></category>
		<category><![CDATA[Win32_DiskDriveToDiskPartition]]></category>
		<category><![CDATA[Win32_LogicalDisk]]></category>
		<category><![CDATA[Win32_LogicalDiskToPartition]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://rvdnieuwendijk.com/?p=549</guid>
		<description><![CDATA[For our Boot From SAN servers we wanted to know the SCSI Lun number of the disks. You can get this information via WMI. But to retrieve it you need four different WMI objects. I made a PowerShell advanced function that combines these four WMI objects to relate the disk with the LUN number. The [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=549&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png"><img class="alignleft size-full wp-image-127" title="PowerShell-logo" src="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png?w=630" alt="PowerShell logo"   /></a>For our Boot From SAN servers we wanted to know the SCSI Lun number of the disks. You can get this information via WMI. But to retrieve it you need four different WMI objects. I made a PowerShell advanced function that combines these four WMI objects to relate the disk with the LUN number.<span id="more-549"></span></p>
<h3>The Get-DiskScsiLun function</h3>
<p>The Get-DiskScsiLun function uses the following WMI objects:<br />
Win32_LogicalDisk, Win32_LogicalDiskToPartition, Win32_DiskDriveToDiskPartition and Win32_DiskDrive.</p>
<p>The first object contains the drive letter. The last object contains the Lun number. And the two other objects are needed to relate the drive letter to the Lun number.</p>
<pre class="brush: powershell; title: ; notranslate">
function Get-DiskScsiLun {
&lt;#
  .SYNOPSIS
    Retrieves the SCSI Lun information for a disk.

  .DESCRIPTION
    Retrieves the SCSI Lun information for a disk.

  .PARAMETER  DeviceID
    Specify the disk name for wich the Scsi Lun information should be retrieved.

  .PARAMETER  ComputerName
    Specifies the computer against which you want to run the management operation.
    The value can be a fully qualified domain name, a NetBIOS name, or an IP
    address. Use the local computer name, use localhost, or use a dot (.) to specify the local
    computer. The local computer is the default.
    When the remote computer is in a different domain from the user, you must use a fully
    qualified domain name. This parameter can also be piped to the cmdlet.

    This parameter does not rely on Windows PowerShell remoting, which uses WS-Management.
    You can use the ComputerName parameter of Get-WmiObject even if your computer is not
    configured to run WS-Management remote commands.

  .PARAMETER  Credential
    Specifies a user account that has permission to perform this action. The default is
    the current user. Type a user name, such as &quot;User01&quot;, &quot;Domain01\User01&quot;,
    or User@Contoso.com. Or, enter a PSCredential object, such as an object that is
    returned by the Get-Credential cmdlet. When you type a user name, you will be prompted
    for a password.

  .EXAMPLE
    PS C:\&gt; Get-DiskScsiLun

  .EXAMPLE
    PS C:\&gt; Get-DiskScsiLun -DeviceID C: -ComputerName Server01 -Credential Domain01\User01

  .EXAMPLE
    PS C:\&gt; &quot;Server01&quot;,&quot;Server02&quot; | Get-DiskScsiLun -Credential Domain01\User01
		
  .INPUTS
    System.String,PSCredential

  .OUTPUTS
    PSObject

  .NOTES
    Author: Robert van den Nieuwendijk
    Version: 1.1
    Date: 17-1-2013

  .LINK

http://rvdnieuwendijk.com/

#&gt;

 [CmdletBinding()]
  param([Parameter(Mandatory = $false,
                   Position = 0)]
        [alias(&quot;Disk&quot;)]
        [string] $DeviceID = '*',
        [Parameter(Mandatory = $false,
                   Position = 1,
                   ValueFromPipeline=$true,
                   ValueFromPipelineByPropertyName=$true)]
        [alias(&quot;CN&quot;)]
        [String[]] $ComputerName = $env:COMPUTERNAME,
        [Parameter(Mandatory=$false,
                   Position = 2)]
        [System.Management.Automation.PSCredential]
        [System.Management.Automation.Credential()] $Credential = [System.Management.Automation.PSCredential]::Empty
  )
  
  process {
    if ($ComputerName)
    {
      # Loop through all computers in the parameter list
      foreach ($Computer in $ComputerName) {
      try {
        if ($Computer -eq &quot;$($env:COMPUTERNAME)&quot; -or $Computer -eq &quot;.&quot; -or $Computer -eq &quot;localhost&quot;)
        {
          # Define the Get-WmiObject parameter set for the local computer
          $Parameters = @{
            Impersonation = 3
            ErrorAction = 'Stop'
          }
        }
        else
        {
          # Define the Get-WmiObject parameter set for remote computers
          $Parameters = @{
            ComputerName = $Computer
            Credential = $Credential
            ErrorAction = 'Stop'
          }
        }
		  
        # Test if the computer can be connected
        if (Test-Connection -ComputerName $Computer -Count 1 -Quiet)	 
        {		  
          # Get the  WMI objects
          $Win32_LogicalDisk = Get-WmiObject -Class Win32_LogicalDisk @Parameters |
            Where-Object {$_.DeviceID -like $DeviceID}
          $Win32_LogicalDiskToPartition = Get-WmiObject -Class Win32_LogicalDiskToPartition @Parameters 
          $Win32_DiskDriveToDiskPartition = Get-WmiObject -Class Win32_DiskDriveToDiskPartition @Parameters 
          $Win32_DiskDrive = Get-WmiObject -Class Win32_DiskDrive @Parameters 
  
          # Search the SCSI Lun Unit for the disk
          $Win32_LogicalDisk |
            ForEach-Object {
              if ($_)
              {
                $LogicalDisk = $_
                $LogicalDiskToPartition = $Win32_LogicalDiskToPartition |
                  Where-Object {$_.Dependent -eq $LogicalDisk.Path}
                if ($LogicalDiskToPartition)
                {
                  $DiskDriveToDiskPartition = $Win32_DiskDriveToDiskPartition |
                    Where-Object {$_.Dependent -eq $LogicalDiskToPartition.Antecedent}
                  if ($DiskDriveToDiskPartition)
                  {
                    $DiskDrive = $Win32_DiskDrive |
                      Where-Object {$_.__Path -eq $DiskDriveToDiskPartition.Antecedent}
                    if ($DiskDrive)
                    {
                      # Return the results
                      New-Object -TypeName PSObject -Property @{
                        Computer = $Computer
                        DeviceID = $LogicalDisk.DeviceID
                        SCSIBus = $DiskDrive.SCSIBus
                        SCSIPort = $DiskDrive.SCSIPort
                        SCSITargetId = $DiskDrive.SCSITargetId
                        SCSILogicalUnit = $DiskDrive.SCSILogicalUnit
                      }
                    }
                  }
                }
              }
            }
          }
          else
          {
            Write-Warning &quot;Unable to connect to computer $Computer.&quot;
          }
        }
        catch {
          Write-Warning &quot;Unable to get disk information for computer $Computer.`n$($_.Exception.Message)&quot;
        }
      }
    }
  }
}
</pre>
<p> Listing 1. The PowerShell advanced function Get-DiskScsiLun that retrieves the SCSI Lun number for a disk.</p>
<h3>Annotations</h3>
<p><strong>Line 79-95</strong>: Build the parameter sets for the Get-WmiObject function calls.</p>
<p><strong>Line 100-105</strong>: Retrieve the WMI objects.</p>
<p><strong>Line 107-138</strong>: Match the disk drive letter to the SCSI Lun information.</p>
<h3>Sample usage</h3>
<p>Output 1 will show you an example of the results you can get when you run the Get-DiskScsiLun function.</p>
<pre class="brush: plain; title: ; notranslate">
Computer  DeviceID SCSIBus SCSIPort SCSITargetId SCSILogicalUnit
--------  -------- ------- -------- ------------ ---------------
server001 C:             0        2            5               1
server001 D:             0        0            4               0
server001 E:             0        2            4               2
server001 F:             0        1            5               3
server001 G:             0        2            4               4
server001 H:             0        1            5              13
server001 I:             0        1            5               5
server001 J:             0        2            5               6
server001 K:             0        2            4               7
server001 L:             0        2            5               8
server001 M:             0        1            4               9
server001 N:             0        1            4              10
server001 O:             0        2            5              11
server001 P:             0        2            5              12
</pre>
<p> Output 1. Sample output of the Get-DiskScsiLun function.</p>
<p><span style="background-color:#ffff00;"><strong>Update</strong></span> 17-1-2013: I modified the Get-DiskScsiLun function to not only retrieve the SCSILogicalUnit but also SCSIBus, SCSIPort and SCSITargetId.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rvdnieuwendijk.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rvdnieuwendijk.wordpress.com/549/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rvdnieuwendijk.com&#038;blog=24740684&#038;post=549&#038;subd=rvdnieuwendijk&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rvdnieuwendijk.com/2012/05/29/powershell-function-to-get-disk-scsi-lun-number/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bb219c35d2787ef4643f273ac5058008?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rvdnieuwendijk</media:title>
		</media:content>

		<media:content url="http://rvdnieuwendijk.files.wordpress.com/2011/07/powershell-logo.png" medium="image">
			<media:title type="html">PowerShell-logo</media:title>
		</media:content>
	</item>
	</channel>
</rss>
