<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get List of VMs, Datastores and VMDK / path per Cluster in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893544#M25417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it worked like a charm for our needs, thanks for sharing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Sep 2015 16:16:58 GMT</pubDate>
    <dc:creator>nscenter</dc:creator>
    <dc:date>2015-09-23T16:16:58Z</dc:date>
    <item>
      <title>Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893492#M25365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as I´m new to this stuff, I´m wondering if anybody has already done some scripting work to gather a list of all virtual machines, its corresponding datastore(s) and the path to the VMDK-Files (or at least the name of it) - I know this part is already solved - found a couple of them &lt;img class="lia-deferred-image lia-image-emoji" src="https://communities.vmware.com/html/@90D223CDF4C4491D7DFF693BB5C76865/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; &lt;/P&gt;&lt;P&gt;But my problem is, I need this script drilled down per Cluster or Datacenter. As I said I´m completly new to this CLI-Stuff and don´t have a clue about how to solve this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Markus &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 09:55:26 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893492#M25365</guid>
      <dc:creator>markus81</dc:creator>
      <dc:date>2012-01-12T09:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893493#M25366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Markus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to the VMware Communities!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next PowerCLI script will give you a list of all your VM's and their Datacenter, Cluster, HardDisks, Datastores and VMDK file paths. If you want to have the VM's only for a certain datacenter or cluster, you can filter the output by piping it to the &lt;A href="http://technet.microsoft.com/nl-nl/library/dd315399(en-us).aspx"&gt;Where-Object &lt;/A&gt;cmdlet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Select-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VM&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Hard Disk&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Datastore&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.FileName.Split(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)[0].TrimStart(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VMDKpath&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.FileName}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;

&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't hesitate to ask in this forum if you need more help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 10:38:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893493#M25366</guid>
      <dc:creator>RvdNieuwendijk</dc:creator>
      <dc:date>2012-01-12T10:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893494#M25367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks! That´s exactly what I´m looking for I think. I´m only struggling with one last thing... the Export-CSV-Thing... My&amp;nbsp; understanding would be someting like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$myVariable | Export-CSV blablabla..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how would i define the $myVariable in your script?&lt;/P&gt;&lt;P&gt;I´m sorry for those really stupid rookie-questions ... have to talk to my boss that I need time and lessons to learn this stuff &lt;img class="lia-deferred-image lia-image-emoji" src="https://communities.vmware.com/html/@90D223CDF4C4491D7DFF693BB5C76865/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 10:59:13 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893494#M25367</guid>
      <dc:creator>markus81</dc:creator>
      <dc:date>2012-01-12T10:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893495#M25368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two options if you want to write the output of the script to a .csv file. You can change the last line of the script into:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="color: #000000;"&gt;} | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Export-Csv&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-NoTypeInformation&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-UseCulture&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Path&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VmInfo.csv&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will pipe the output of the script to the &lt;A href="http://technet.microsoft.com/nl-nl/library/dd347724(en-us).aspx"&gt;Export-CSV&lt;/A&gt; cmdlet. And it will create a .csv file called VmInfo.csv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second option is to change the first line of the script into:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800080;"&gt;$VmInfo&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And append the following line at the end of the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800080;"&gt;$VmInfo&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Export-Csv&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-NoTypeInformation&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-UseCulture&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Path&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VmInfo.csv&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will put the output of the script from my previous post into a variable $VmInfo. In the last line the variable is used to output it to a .csv file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 11:57:30 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893495#M25368</guid>
      <dc:creator>RvdNieuwendijk</dc:creator>
      <dc:date>2012-01-12T11:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893496#M25369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Isn't option 1 giving you the infamous "&lt;EM&gt;An empty pipe element is not allowed.&lt;/EM&gt;" error ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 12:00:15 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893496#M25369</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-01-12T12:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893497#M25370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Luc, you are right. I should have tested this.&amp;nbsp; &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.vmware.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a disadvantage of the ForEach command that I almost never use. Normally I use the Foreach-Object cmdlet and that works fine with pipeing the output to Export-CSV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Markus you have to use option 2 in this case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 12:14:50 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893497#M25370</guid>
      <dc:creator>RvdNieuwendijk</dc:creator>
      <dc:date>2012-01-12T12:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893498#M25371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You guys are crazy &lt;img class="lia-deferred-image lia-image-emoji" src="https://communities.vmware.com/html/@90D223CDF4C4491D7DFF693BB5C76865/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Exactly what I&amp;nbsp; need &lt;img class="lia-deferred-image lia-image-emoji" src="https://communities.vmware.com/html/@DCF4E2F7991292CEECF250394DB2C2BC/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; Many thanks to you ! Have just tested and works fine! If I find some spare time I´m trying to modify it a little bit more for more granularity in regards of choosing the cluster manually but for now that works perfect &lt;img class="lia-deferred-image lia-image-emoji" src="https://communities.vmware.com/html/@DCF4E2F7991292CEECF250394DB2C2BC/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;BR /&gt;Markus &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 12:43:59 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893498#M25371</guid>
      <dc:creator>markus81</dc:creator>
      <dc:date>2012-01-12T12:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893499#M25372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shame on me... Forgot one more thing .... Configuratio File of the VM...&lt;/P&gt;&lt;P&gt;Can anyone give a hint how to include this also?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 14:03:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893499#M25372</guid>
      <dc:creator>markus81</dc:creator>
      <dc:date>2012-01-12T14:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893500#M25373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can add the VM's configuration file to the script by changing the script into:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800080;"&gt;$VmInfo&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Get-HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Select-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VM&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Hard Disk&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;Datastore&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.FileName.Split(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)[0].TrimStart(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VMConfigFile&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.ExtensionData.Config.Files.VmPathName}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VMDKpath&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.FileName}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}
&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VmInfo&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; | &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-weight: bold;"&gt;Export-Csv&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-NoTypeInformation&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-UseCulture&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0; font-style: italic;"&gt;-Path&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;VmInfo.csv&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 14:09:57 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893500#M25373</guid>
      <dc:creator>RvdNieuwendijk</dc:creator>
      <dc:date>2012-01-12T14:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893501#M25374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Great script, works well, but I was wondering if it's possible to get the size of the VMDK file added to the output as well? How would I do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 21:29:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893501#M25374</guid>
      <dc:creator>GlennL10</dc:creator>
      <dc:date>2012-03-06T21:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893502#M25375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;I will just add one line to this

$VmInfo = ForEach ($Datacenter in (Get-Datacenter | Sort-Object -Property Name)) {
&amp;nbsp; ForEach ($Cluster in ($Datacenter | Get-Cluster | Sort-Object -Property Name)) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($VM in ($Cluster | Get-VM | Sort-Object -Property Name)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($HardDisk in ($VM | Get-HardDisk | Sort-Object -Property Name)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "" | Select-Object -Property @{N="VM";E={$VM.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Datacenter";E={$Datacenter.name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Cluster";E={$Cluster.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Hard Disk";E={$HardDisk.Name}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Datastore";E={$HardDisk.FileName.Split("]")[0].TrimStart("[")}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VMConfigFile";E={$VM.ExtensionData.Config.Files.VmPathName}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VMDKpath";E={$HardDisk.FileName}},
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VMDK Size";E={($vm.extensiondata.layoutex.file|?{$_.name -contains $harddisk.filename.replace(".","-flat.")}).size/1GB}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}
$VmInfo | Export-Csv -NoTypeInformation -UseCulture -Path "VmInfo.csv"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: CRad14&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 16:06:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893502#M25375</guid>
      <dc:creator>CRad14</dc:creator>
      <dc:date>2012-03-07T16:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893503#M25376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, but I don't get the sizes in the final report, in fact it's still the same?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 20:44:09 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893503#M25376</guid>
      <dc:creator>GlennL10</dc:creator>
      <dc:date>2012-03-07T20:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893504#M25377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hah!!! I missed a comma, I edited that post, it should be correct now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 20:45:54 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893504#M25377</guid>
      <dc:creator>CRad14</dc:creator>
      <dc:date>2012-03-07T20:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893505#M25378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help, it works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 20:58:06 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893505#M25378</guid>
      <dc:creator>GlennL10</dc:creator>
      <dc:date>2012-03-07T20:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893506#M25379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to capture multiple IP address of those VMs as well? Tried to include some of the scripts I got online to merge with this one but just couldn't get it to work correctly. Currently, I only manage to capture 1 IP address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="_mcePaste"&gt;$VmInfo = ForEach ($Datacenter in (Get-Datacenter | Sort-Object -Property Name)) {&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp; ForEach ($Cluster in ($Datacenter | Get-Cluster | Sort-Object -Property Name)) { &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($VM in ($Cluster | Get-VM | Sort-Object -Property Name)) {&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($IP in $VM.Guest.IPAddress) {&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForEach ($HardDisk in ($VM | Get-HardDisk | Sort-Object -Property Name)) {&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "" | Select-Object -Property @{N="VM";E={$VM.Name}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Datacenter";E={$Datacenter.name}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Cluster";E={$Cluster.Name}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="IP";E={$IP}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Hard Disk";E={$HardDisk.Name}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Datastore";E={$HardDisk.FileName.Split("]")[0].TrimStart("[")}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VMConfigFile";E={$VM.ExtensionData.Config.Files.VmPathName}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VMDKpath";E={$HardDisk.FileName}},&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VMDK Size";E={($vm.extensiondata.layoutex.file|?{$_.name -contains $harddisk.filename.replace(".","-flat.")}).size/1GB}}&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;}&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp; }&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;}&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;$VmInfo | Export-Csv -NoTypeInformation -UseCulture -Path "VmInfo.csv"&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 05:51:06 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893506#M25379</guid>
      <dc:creator>alize77</dc:creator>
      <dc:date>2012-06-08T05:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893507#M25380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The IPAddress property is an array, you can always join the elements of this array into 1 string.&lt;/P&gt;&lt;P&gt;But note that you will get these same IP addresses (VM-level) displayed for each harddisk attached to that VM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800080;"&gt;$VmInfo&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;ForEach&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Sort-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Select-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Property&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"VM"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"Datacenter"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Datacenter&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"Cluster"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Cluster&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"IP"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{[&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;Join&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;Guest&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;IPAddress&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"Hard Disk"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"Datastore"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;Split&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"]"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)[&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;TrimStart&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"["&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"VMConfigFile"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;ExtensionData&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;Config&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;Files&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;VmPathName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"VMDKpath"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$HardDisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"VMDK Size"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{(&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$vm&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;extensiondata&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;layoutex&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;file|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;?&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;$_&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;-contains&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$harddisk&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #8B4513;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"-flat."&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)})&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;size&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;/&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;GB&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}
&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$VmInfo&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Export-Csv&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-NoTypeInformation&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-UseCulture&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Path&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"VmInfo.csv"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 05:59:18 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893507#M25380</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-06-08T05:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893508#M25381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - coming a little late to the party, but I believe this is the script that I'm looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm pretty new to scripting for PowerCLI and having issues getting this working on our infrastructure.&amp;nbsp; Getting an "Unexpected token '&amp;lt;' in expression or statement" error at line 10, character 72.&amp;nbsp; Seems that it doesn't like the closed square bracket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We're running version 4.1 and I'm using PowerCLI 4.1 as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;--- A &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 16:57:08 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893508#M25381</guid>
      <dc:creator>zerotraction</dc:creator>
      <dc:date>2012-06-12T16:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893509#M25382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you do not have a good reason to stick with PowerCLI 4.1, I would in any case advise an upgrade.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's first check if the copy/paste didn't introduce an error.&lt;/P&gt;&lt;P&gt;Try the attached script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And copy the complete error message, should it still appear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 17:03:18 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893509#M25382</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-06-12T17:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893510#M25383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When running the attached script, I get another error "Export-CSV : Cannot bind argument to parameter 'InputObject' because it is null." at Line 18, Character 21 (which is the - in -NoTypeInformation, etc.) in the last line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking your advice to upgrade to PowerCLI 5.0.1 and hoping that that makes this issue go away.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;--- A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 17:11:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893510#M25383</guid>
      <dc:creator>zerotraction</dc:creator>
      <dc:date>2012-06-12T17:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get List of VMs, Datastores and VMDK / path per Cluster</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893511#M25384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That would mean that the variable $VmInfo is empty ?&lt;/P&gt;&lt;P&gt;Try displaying the result on screen, remove the Export-Csv cmdlet at the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 17:21:14 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-Datastores-and-VMDK-path-per-Cluster/m-p/893511#M25384</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-06-12T17:21:14Z</dc:date>
    </item>
  </channel>
</rss>

