<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>VMware Communities: Message List - Get-CDDrive</title>
    <link>http://communities.vmware.com/community/vmtn/vsphere/automationtools/windows_toolkit?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Tue, 07 Jul 2009 08:32:43 GMT</pubDate>
    <generator>Clearspace 1.10.12 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2009-07-07T08:32:43Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/1304039?tstart=0#1304039</link>
      <description>Hi Luc,&lt;br /&gt;
&lt;br /&gt;
Brilliant!&lt;br /&gt;
This does exactly what I was looking for.&lt;br /&gt;
Thank you so much!&lt;br /&gt;
&lt;br /&gt;
Just one question, if I run your query on the PS command-line, it output is perfect!&lt;br /&gt;
But when I put it in a .ps1 script and run it it from the same PS Command line it throws this error at me:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;out-lineoutput : Object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not legal or not in the correct&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;sequence. This is likely caused by a user-specified "format-table" command which is conflicting with the default formatting.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Any idea? &lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Thanks again.&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Harold</description>
      <pubDate>Tue, 07 Jul 2009 08:22:46 GMT</pubDate>
      <author>hharold</author>
      <guid>http://communities.vmware.com/message/1304039?tstart=0#1304039</guid>
      <dc:date>2009-07-07T08:22:46Z</dc:date>
      <clearspace:dateToText>4 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/1302521?tstart=0#1302521</link>
      <description>&lt;br /&gt;
Thanks man!&lt;br /&gt;
&lt;p /&gt;
I am still learning, and I can learn a lot from oneliners like this one !&lt;br /&gt;
&lt;br /&gt;
I will try this one monday at the office.&lt;br /&gt;
&lt;p /&gt;
Thanks again, &lt;br /&gt;
&lt;p /&gt;
 Harold</description>
      <pubDate>Sat, 04 Jul 2009 18:06:15 GMT</pubDate>
      <author>hharold</author>
      <guid>http://communities.vmware.com/message/1302521?tstart=0#1302521</guid>
      <dc:date>2009-07-04T18:06:15Z</dc:date>
      <clearspace:dateToText>4 months, 3 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/1302268?tstart=0#1302268</link>
      <description>Sorry, duplicate post.</description>
      <pubDate>Fri, 03 Jul 2009 20:00:31 GMT</pubDate>
      <author>LucD</author>
      <guid>http://communities.vmware.com/message/1302268?tstart=0#1302268</guid>
      <dc:date>2009-07-03T20:00:31Z</dc:date>
      <clearspace:dateToText>4 months, 3 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/1302239?tstart=0#1302239</link>
      <description>Try this. It should also work for guests that more than 1 CD/DVD drive&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt; 
Get-VM | where {$_.cddrives | %{$_.IsoPath -ne $null}} | ft name,@{label=&amp;quot;ISOPath&amp;quot;; Expr = { ($_ | get-cddrive).ISOPath } }
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Fri, 03 Jul 2009 19:04:02 GMT</pubDate>
      <author>LucD</author>
      <guid>http://communities.vmware.com/message/1302239?tstart=0#1302239</guid>
      <dc:date>2009-07-03T19:04:02Z</dc:date>
      <clearspace:dateToText>4 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/1302072?tstart=0#1302072</link>
      <description>&lt;p /&gt;
&lt;p /&gt;
&lt;div class="jive-quote"&gt;&lt;span class="jive-quote-header"&gt;halr9000 wrote:&lt;/span&gt;&lt;br /&gt;
&lt;p /&gt;
Get-VM pa* | ft name,@{label="ISOPath"; Expr = { ($_ | get-cddrive).ISOPath  } }&lt;br /&gt;
&lt;/div&gt;
&lt;p /&gt;
Nice one indeed, but.....  how can I get this output ONLY for VM's that have connected media?&lt;br /&gt;
&lt;p /&gt;
Regards,&lt;br /&gt;
&lt;p /&gt;
 Harold &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;</description>
      <pubDate>Fri, 03 Jul 2009 14:59:50 GMT</pubDate>
      <author>hharold</author>
      <guid>http://communities.vmware.com/message/1302072?tstart=0#1302072</guid>
      <dc:date>2009-07-03T14:59:50Z</dc:date>
      <clearspace:dateToText>4 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/922784?tstart=0#922784</link>
      <description>&lt;br /&gt;
Borrowing from another post and the example in the VMWare blog beta announcement&lt;br /&gt;
&lt;p /&gt;
get-viserver vcserver.FQDN # provide your credentials when prompted | Get-VM | Get-CDDrive | ? { $_.ConnectionState.Connected -eq "true" } | Set-CDDrive -Connected:$false -Confirm:$false&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;a class="jive-link-external" href="http://blogs.vmware.com/vipowershell/2008/03/we-are-beta.html"&gt;http://blogs.vmware.com/vipowershell/2008/03/we-are-beta.html&lt;/a&gt;</description>
      <pubDate>Tue, 22 Apr 2008 22:59:24 GMT</pubDate>
      <author>sepeck</author>
      <guid>http://communities.vmware.com/message/922784?tstart=0#922784</guid>
      <dc:date>2008-04-22T22:59:24Z</dc:date>
      <clearspace:dateToText>1 year, 7 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/922565?tstart=0#922565</link>
      <description>&lt;br /&gt;
So is it possible to incorporate all in a .ps1 script that will first connect to VC and then diconnect the CD-ROMs such as:&lt;br /&gt;
&lt;p /&gt;
get-VC vcserver.FQDN | get-cddrive | ? { $_.ConnectionState.Connected -eq "true" } |&lt;br /&gt;
Set-CDDrive -Connected:$false -Confirm:$false</description>
      <pubDate>Tue, 22 Apr 2008 20:11:18 GMT</pubDate>
      <author>astrolab</author>
      <guid>http://communities.vmware.com/message/922565?tstart=0#922565</guid>
      <dc:date>2008-04-22T20:11:18Z</dc:date>
      <clearspace:dateToText>1 year, 7 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/833611?tstart=0#833611</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
If you are trying to disconnect the CD-drive from the connected VM's. You can do it by using the below commands&lt;br /&gt;
&lt;p /&gt;
$d = &lt;b&gt;Get-VM&lt;/b&gt; &lt;br /&gt;
&lt;p /&gt;
$cd = &lt;b&gt;Get-CDDrive&lt;/b&gt; &lt;i&gt;-VM&lt;/i&gt; $d &lt;br /&gt;
&lt;br /&gt;
Set-CDDrive -CD $cd -Connected 0 -StartConnected 0 &lt;br /&gt;
&lt;br /&gt;
You have to connect to the VC first.&lt;br /&gt;
Hope this helps &lt;img class="jive-emoticon" border="0" src="http://communities.vmware.com/images/emoticons/happy.gif" alt=":)" /&gt;</description>
      <pubDate>Mon, 07 Jan 2008 10:45:45 GMT</pubDate>
      <author>Rajeev S</author>
      <guid>http://communities.vmware.com/message/833611?tstart=0#833611</guid>
      <dc:date>2008-01-07T10:45:45Z</dc:date>
      <clearspace:dateToText>1 year, 10 months ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/832305?tstart=0#832305</link>
      <description>Excellent!  Be sure to award points as you feel appropriate so that the community will see this as an answered question.</description>
      <pubDate>Fri, 04 Jan 2008 17:09:17 GMT</pubDate>
      <author>halr9000</author>
      <guid>http://communities.vmware.com/message/832305?tstart=0#832305</guid>
      <dc:date>2008-01-04T17:09:17Z</dc:date>
      <clearspace:dateToText>1 year, 10 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/832295?tstart=0#832295</link>
      <description>Thanks that worked for me!</description>
      <pubDate>Fri, 04 Jan 2008 17:04:12 GMT</pubDate>
      <author>ief</author>
      <guid>http://communities.vmware.com/message/832295?tstart=0#832295</guid>
      <dc:date>2008-01-04T17:04:12Z</dc:date>
      <clearspace:dateToText>1 year, 10 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/832192?tstart=0#832192</link>
      <description>Here's an example of how you can combine data from two cmdlets using calculated properties.&lt;br /&gt;
&lt;br /&gt;
54# Get-VM pa* | ft name,@{label="ISOPath"; Expr = { ($_ | get-cddrive).ISOPath  } }&lt;br /&gt;
&lt;br /&gt;
Name                                             ISOPath&lt;br /&gt;
----&lt;hr /&gt;
patch2003x64&lt;br /&gt;
patch2003r2x64&lt;br /&gt;
patchvistaent_Vista Enterprise&lt;br /&gt;
patchxpx64sp1&lt;br /&gt;
patch2003sp1x64&lt;br /&gt;
patch2003sp2x64ie7                               [] /vmimages/tools-isoimages/windows.iso</description>
      <pubDate>Fri, 04 Jan 2008 15:33:23 GMT</pubDate>
      <author>halr9000</author>
      <guid>http://communities.vmware.com/message/832192?tstart=0#832192</guid>
      <dc:date>2008-01-04T15:33:23Z</dc:date>
      <clearspace:dateToText>1 year, 10 months ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/832188?tstart=0#832188</link>
      <description>I added a feature request for something like this. If it is urgent I can help with a quick sript that will output a custom object.</description>
      <pubDate>Fri, 04 Jan 2008 15:27:09 GMT</pubDate>
      <author>bshell</author>
      <guid>http://communities.vmware.com/message/832188?tstart=0#832188</guid>
      <dc:date>2008-01-04T15:27:09Z</dc:date>
      <clearspace:dateToText>1 year, 10 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Get-CDDrive</title>
      <link>http://communities.vmware.com/message/832079?tstart=0#832079</link>
      <description>The Get-CDDrive will only return information when given a VM, Template, or SnapShot, so I think we will need more clarification on what you are looking for. Just issuing the Get-CDDrive command without any parameters does not return any results.&lt;br /&gt;
&lt;br /&gt;
However, if you do a Get-VM | Get-CDDrive, you will want to look at the ID line. It should say something like "VirtualMachine-##/3000". The "##" will contain the ID number of the VM that the Drive is connected to. I am not sure if you can get that number from powershell, but I checked it using the VI API and the number (##) does correspond to the VM id number on my box. You can also find the ID number by using the MOB of your host server (&lt;a class="jive-link-external" href="https://server/mob"&gt;https://server/mob&lt;/a&gt;)</description>
      <pubDate>Fri, 04 Jan 2008 13:56:19 GMT</pubDate>
      <author>JPatten</author>
      <guid>http://communities.vmware.com/message/832079?tstart=0#832079</guid>
      <dc:date>2008-01-04T13:56:19Z</dc:date>
      <clearspace:dateToText>1 year, 10 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Get-CDDrive</title>
      <link>http://communities.vmware.com/message/831979?tstart=0#831979</link>
      <description>&lt;br /&gt;
By using the Get-CDdrive command,  Is it possible to display the VM name the CDdrive is connected to?</description>
      <pubDate>Fri, 04 Jan 2008 10:59:22 GMT</pubDate>
      <author>ief</author>
      <guid>http://communities.vmware.com/message/831979?tstart=0#831979</guid>
      <dc:date>2008-01-04T10:59:22Z</dc:date>
      <clearspace:dateToText>1 year, 10 months ago</clearspace:dateToText>
      <clearspace:replyCount>13</clearspace:replyCount>
    </item>
  </channel>
</rss>

