<?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 Match wildcard in -filter in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Match-wildcard-in-filter/m-p/2919428#M107464</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I realize this is likely a very simple question, but I can't come up with an answer. I need to pull a list of VM's using Get-View with the '-filter' option, but having trouble with the correct Regex expression.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I.e,&amp;nbsp;get-view –viewtype VirtualMachine -filter @{'Name' = '^((*$Cluster*).)*$'}&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Where $Cluster would be the cluster name, providing only the VM's for that specific cluster. The expression above returns no VMs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2022 21:43:30 GMT</pubDate>
    <dc:creator>MR_HPE</dc:creator>
    <dc:date>2022-07-19T21:43:30Z</dc:date>
    <item>
      <title>Match wildcard in -filter</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Match-wildcard-in-filter/m-p/2919428#M107464</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I realize this is likely a very simple question, but I can't come up with an answer. I need to pull a list of VM's using Get-View with the '-filter' option, but having trouble with the correct Regex expression.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I.e,&amp;nbsp;get-view –viewtype VirtualMachine -filter @{'Name' = '^((*$Cluster*).)*$'}&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Where $Cluster would be the cluster name, providing only the VM's for that specific cluster. The expression above returns no VMs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 21:43:30 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Match-wildcard-in-filter/m-p/2919428#M107464</guid>
      <dc:creator>MR_HPE</dc:creator>
      <dc:date>2022-07-19T21:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Match wildcard in -filter</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Match-wildcard-in-filter/m-p/2919462#M107466</link>
      <description>&lt;P&gt;The Filter is based on a property in the object(s) you want to retrieve.&lt;BR /&gt;Since the VirtualMachine object does not have a property indicating the Cluster, that is hard/impossible to do.&lt;BR /&gt;&lt;BR /&gt;A better option is to use the SearchRoot parameter.&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;$cl = Get-Cluster -Name $cluster

Get-View -ViewType VirtualMachine -SearchRoot $cl.Id&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Jul 2022 05:09:31 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Match-wildcard-in-filter/m-p/2919462#M107466</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2022-07-20T05:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Match wildcard in -filter</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Match-wildcard-in-filter/m-p/2919536#M107472</link>
      <description>&lt;P&gt;Thank you Luc, that worked perfectly. Nice to see you're still involved in helping people on the PowerCLI side.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 13:00:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Match-wildcard-in-filter/m-p/2919536#M107472</guid>
      <dc:creator>MR_HPE</dc:creator>
      <dc:date>2022-07-20T13:00:25Z</dc:date>
    </item>
  </channel>
</rss>

