<?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: To Check if a virtual object is VM or template in vSphere Update Manager PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150449#M489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are 2 cmdlets, Get-VM and Get-Template.&lt;/P&gt;&lt;P&gt;If you suppress the errors you could use those. For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;$names = Get-Content names.txt&lt;/P&gt;
&lt;P&gt;$vms = Get-VM -Name $names -ErrorAction SIlentlyContinue&lt;/P&gt;
&lt;P&gt;$templates = Get-Template -Name $names -ErrorAction SilentlyContinue&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;Or do you mean something else ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2014 09:08:01 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2014-05-30T09:08:01Z</dc:date>
    <item>
      <title>To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150448#M488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to check for a list of VMs\Templates, which ones are templates. Is there a way to do that - powercli way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 09:03:02 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150448#M488</guid>
      <dc:creator>itsvivekg</dc:creator>
      <dc:date>2014-05-30T09:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150449#M489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are 2 cmdlets, Get-VM and Get-Template.&lt;/P&gt;&lt;P&gt;If you suppress the errors you could use those. For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;$names = Get-Content names.txt&lt;/P&gt;
&lt;P&gt;$vms = Get-VM -Name $names -ErrorAction SIlentlyContinue&lt;/P&gt;
&lt;P&gt;$templates = Get-Template -Name $names -ErrorAction SilentlyContinue&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;Or do you mean something else ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 09:08:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150449#M489</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2014-05-30T09:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150450#M490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An alternative&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;$names = Get-Content names.txt&lt;/P&gt;
&lt;P&gt;$namesRegEx = $names -Join '|'&lt;/P&gt;
&lt;P&gt;Get-View -ViewType VirtualMachine -Filter @{"Name"=$namesRegEx} |&lt;/P&gt;
&lt;P&gt;Select Name,@{N="Template";E={$_.Config.Template}}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 09:13:38 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150450#M490</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2014-05-30T09:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150451#M491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using this, but its not helping -&lt;/P&gt;&lt;P&gt;$TEMPLATE = (get-Template $VM_NAME).Name&lt;/P&gt;&lt;P&gt;If ($TEMPLATE -eq $VM_Name)&lt;/P&gt;&lt;P&gt;{$CHK = "TEMPLATE"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing, When I m taking $cells.item($i,8)&amp;nbsp; = (Get-VM $INPUT_IP|Select PowerState) , its thowing "0" for Powered OFF VMs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 09:19:27 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150451#M491</guid>
      <dc:creator>itsvivekg</dc:creator>
      <dc:date>2014-05-30T09:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150452#M492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try any of the 2 sample script I gave ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 09:57:47 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150452#M492</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2014-05-30T09:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150453#M493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I havent tried it yet.But I need something to check one server one time.&lt;/P&gt;&lt;P&gt;Can you convert this for my need -&lt;/P&gt;&lt;P&gt;&lt;CODE class="plain powershell"&gt;Get&lt;/CODE&gt;&lt;CODE class="keyword powershell"&gt;-View&lt;/CODE&gt; &lt;CODE class="keyword powershell"&gt;-ViewType&lt;/CODE&gt; &lt;CODE class="plain powershell"&gt;VirtualMachine &lt;/CODE&gt;&lt;CODE class="keyword powershell"&gt;-Property&lt;/CODE&gt; &lt;CODE class="plain powershell"&gt;Name &lt;/CODE&gt;&lt;CODE class="plain powershell"&gt;&lt;/CODE&gt;&lt;CODE class="keyword powershell"&gt;-Filter&lt;/CODE&gt; &lt;CODE class="plain powershell"&gt;@{&lt;/CODE&gt;&lt;CODE class="string powershell"&gt;"Config.Template"&lt;/CODE&gt; &lt;CODE class="plain powershell"&gt;= &lt;/CODE&gt;&lt;CODE class="string powershell"&gt;"true"&lt;/CODE&gt;&lt;CODE class="plain powershell"&gt;}&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 11:39:35 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150453#M493</guid>
      <dc:creator>itsvivekg</dc:creator>
      <dc:date>2014-05-30T11:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150454#M494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure waht you mean with "one server", is that 1 vCenter or 1 ESXi server ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 12:04:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150454#M494</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2014-05-30T12:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150455#M495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One VM\template at a time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 May 2014 06:04:24 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150455#M495</guid>
      <dc:creator>itsvivekg</dc:creator>
      <dc:date>2014-05-31T06:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: To Check if a virtual object is VM or template</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150456#M496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid I still don't get what exactly you want here.&lt;/P&gt;&lt;P&gt;Do you want to enter a name and then check if it's a VM or a template ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 May 2014 21:36:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/To-Check-if-a-virtual-object-is-VM-or-template/m-p/2150456#M496</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2014-05-31T21:36:49Z</dc:date>
    </item>
  </channel>
</rss>

