<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PowerCLI: Folder Name Mismatch</title>
	<atom:link href="http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/</link>
	<description>Virtually everything is poshable</description>
	<lastBuildDate>Thu, 09 Feb 2012 21:00:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Aaron</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-11741</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Fri, 23 Dec 2011 18:38:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-11741</guid>
		<description>Yeah, it might be encoding or something of that nature. I copied from another blog that linked back to this page and it worked. Odd.</description>
		<content:encoded><![CDATA[<p>Yeah, it might be encoding or something of that nature. I copied from another blog that linked back to this page and it worked. Odd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-11740</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Fri, 23 Dec 2011 17:10:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-11740</guid>
		<description>Just tried it against mine, all is fine, copy and paste issue ?</description>
		<content:encoded><![CDATA[<p>Just tried it against mine, all is fine, copy and paste issue ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-11730</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Fri, 23 Dec 2011 02:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-11730</guid>
		<description>Is this working for anyone in vcenter/powercli 5.0? Has worked for me before in 4.1 but not now. 

I&#039;m getting a &quot;Missing &#039;)&#039; in method call.&quot; error line 5 character 51</description>
		<content:encoded><![CDATA[<p>Is this working for anyone in vcenter/powercli 5.0? Has worked for me before in 4.1 but not now. </p>
<p>I&#8217;m getting a &#8220;Missing &#8216;)&#8217; in method call.&#8221; error line 5 character 51</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VM folder name mismatch query using PowerShell - motogobi</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-3608</link>
		<dc:creator>VM folder name mismatch query using PowerShell - motogobi</dc:creator>
		<pubDate>Mon, 06 Dec 2010 20:48:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-3608</guid>
		<description>[...] off to Luc at www.virtu-al.net for this incredibly useful PowerShell script to identify the display names of VMs and any that don&#8217;t match their folder structure. If [...]</description>
		<content:encoded><![CDATA[<p>[...] off to Luc at <a href="http://www.virtu-al.net" rel="nofollow">http://www.virtu-al.net</a> for this incredibly useful PowerShell script to identify the display names of VMs and any that don&#8217;t match their folder structure. If [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-2551</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 04 Aug 2010 01:39:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-2551</guid>
		<description>&lt;blockquote&gt;
...(50% fewer calls to &quot;match&quot;).  And, for clarity’s sake, you could add some named capture groups (such as &quot;?&quot;):
…
if ($VmPathName -match &quot;(?\[.+\] (?.+))/&quot;) {$Folder = $Matches[&#039;folder&#039;]; $Path = $Matches[&#039;path&#039;];}
…
&lt;/blockquote&gt;

Doh, looks like the code was broken a bit due to interpreted/discarded angle brackets .  That last part should have been something like:


...(50% fewer calls to &quot;match&quot;).  And, for clarity’s sake, you could add some named capture groups (such as &quot;&lt;B&gt;?&lt;path&gt;&lt;/B&gt;&quot;):
if ($VmPathName -match &quot;(?&lt;B&gt;&lt;path&gt;&lt;/B&gt;\[.+\] (?&lt;B&gt;&lt;folder&gt;&lt;/B&gt;.+))/&quot;) {$Folder = $Matches[&#039;folder&#039;]; $Path = $Matches[&#039;path&#039;];}

...that is, if I have it right, now (no preview for this comment).</description>
		<content:encoded><![CDATA[<blockquote><p>
&#8230;(50% fewer calls to &#8220;match&#8221;).  And, for clarity’s sake, you could add some named capture groups (such as &#8220;?&#8221;):<br />
…<br />
if ($VmPathName -match &#8220;(?\[.+\] (?.+))/&#8221;) {$Folder = $Matches['folder']; $Path = $Matches['path'];}<br />
…
</p></blockquote>
<p>Doh, looks like the code was broken a bit due to interpreted/discarded angle brackets .  That last part should have been something like:</p>
<p>&#8230;(50% fewer calls to &#8220;match&#8221;).  And, for clarity’s sake, you could add some named capture groups (such as &#8220;<b>?&lt;path&gt;</b>&#8220;):<br />
if ($VmPathName -match &#8220;(?<b>&lt;path&gt;</b>\[.+\] (?<b>&lt;folder&gt;</b>.+))/&#8221;) {$Folder = $Matches['folder']; $Path = $Matches['path'];}</p>
<p>&#8230;that is, if I have it right, now (no preview for this comment).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-2549</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 03 Aug 2010 20:04:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-2549</guid>
		<description>Hello-

@Harley

You should probably be able to change the regex from using word characters to using any, since the matching/grouping in this instance is based on the &quot;] &quot; and the trailing &quot;/&quot;.  That is, like so:

…
$VmPathName = $VM.Summary.Config.VmPathName
$Folder = ([regex]&quot;\[.+\] (.+)/&quot;).match($VmPathName).Groups[1].Value
$Path = ([regex]&quot;(\[.+\] .+)/&quot;).match($VmPathName).Groups[1].Value
…

For efficiency&#039;s sake, you could also write it as:

…
if ($VmPathName -match &quot;(\[.+\] (.+))/&quot;) {$Folder = $Matches[2]; $Path = $Matches[1];}
…

(50% fewer calls to &quot;match&quot;).  And, for clarity&#039;s sake, you could add some named capture groups (such as &quot;?&quot;):

…
if ($VmPathName -match &quot;(?\[.+\] (?.+))/&quot;) {$Folder = $Matches[&#039;folder&#039;]; $Path = $Matches[&#039;path&#039;];}
…

Matt</description>
		<content:encoded><![CDATA[<p>Hello-</p>
<p>@Harley</p>
<p>You should probably be able to change the regex from using word characters to using any, since the matching/grouping in this instance is based on the &#8220;] &#8221; and the trailing &#8220;/&#8221;.  That is, like so:</p>
<p>…<br />
$VmPathName = $VM.Summary.Config.VmPathName<br />
$Folder = ([regex]&#8220;\[.+\] (.+)/&#8221;).match($VmPathName).Groups[1].Value<br />
$Path = ([regex]&#8220;(\[.+\] .+)/&#8221;).match($VmPathName).Groups[1].Value<br />
…</p>
<p>For efficiency&#8217;s sake, you could also write it as:</p>
<p>…<br />
if ($VmPathName -match &#8220;(\[.+\] (.+))/&#8221;) {$Folder = $Matches[2]; $Path = $Matches[1];}<br />
…</p>
<p>(50% fewer calls to &#8220;match&#8221;).  And, for clarity&#8217;s sake, you could add some named capture groups (such as &#8220;?&#8221;):</p>
<p>…<br />
if ($VmPathName -match &#8220;(?\[.+\] (?.+))/&#8221;) {$Folder = $Matches['folder']; $Path = $Matches['path'];}<br />
…</p>
<p>Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harley Stagner</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-1017</link>
		<dc:creator>Harley Stagner</dc:creator>
		<pubDate>Tue, 15 Sep 2009 18:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-1017</guid>
		<description>Thank you for the awesome script!

@LucD

Thank you for the regex LudD. However, I am having some problems with the matching when there is a non-word character (e.g. dash or underscore) in the VM Name. Any suggestions?</description>
		<content:encoded><![CDATA[<p>Thank you for the awesome script!</p>
<p>@LucD</p>
<p>Thank you for the regex LudD. However, I am having some problems with the matching when there is a non-word character (e.g. dash or underscore) in the VM Name. Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Virtu-Al</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-723</link>
		<dc:creator>Virtu-Al</dc:creator>
		<pubDate>Wed, 29 Jul 2009 15:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-723</guid>
		<description>&lt;a href=&quot;#comment-676&quot; rel=&quot;nofollow&quot;&gt;@Alex &lt;/a&gt; 
Thanks for the kind comments</description>
		<content:encoded><![CDATA[<p><a href="#comment-676" rel="nofollow">@Alex </a><br />
Thanks for the kind comments</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-676</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 21 Jul 2009 21:49:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-676</guid>
		<description>You think of everything that&#039;s annoyed me in the last couple of years.  Perfect and thanks again.  Glad I found this site.</description>
		<content:encoded><![CDATA[<p>You think of everything that&#8217;s annoyed me in the last couple of years.  Perfect and thanks again.  Glad I found this site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Virtu-Al</title>
		<link>http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/#comment-543</link>
		<dc:creator>Virtu-Al</dc:creator>
		<pubDate>Tue, 23 Jun 2009 07:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=716#comment-543</guid>
		<description>&lt;a href=&quot;#comment-542&quot; rel=&quot;nofollow&quot;&gt;@amusica &lt;/a&gt; 
Consistency is the key, thanks for the comment.</description>
		<content:encoded><![CDATA[<p><a href="#comment-542" rel="nofollow">@amusica </a><br />
Consistency is the key, thanks for the comment.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

