<?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: Are your names in sync? (Helpful Script of the Day)</title>
	<atom:link href="http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/</link>
	<description>Using Powershell for (virtually) everything!</description>
	<lastBuildDate>Fri, 27 Aug 2010 15:06:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Craig</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-6138</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Tue, 09 Jun 2009 19:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-6138</guid>
		<description>I added a simple error skiping routine to clean things up.

Make the first line of the script: $errorActionPreference = “Stop”

In the ForEach loop add the trap {continue} statement after the last file and before the counter as shown:

	$myObj.Disk3File = $VM.HardDisks[2].FileName.Split(&quot; /.&quot;)[2]
	trap{
		continue
		}
		$myCol += $myObj

When the script encounters a null error, it will jump to the trap and then just continue to the next VM in the array.</description>
		<content:encoded><![CDATA[<p>I added a simple error skiping routine to clean things up.</p>
<p>Make the first line of the script: $errorActionPreference = “Stop”</p>
<p>In the ForEach loop add the trap {continue} statement after the last file and before the counter as shown:</p>
<p>	$myObj.Disk3File = $VM.HardDisks[2].FileName.Split(&#8221; /.&#8221;)[2]<br />
	trap{<br />
		continue<br />
		}<br />
		$myCol += $myObj</p>
<p>When the script encounters a null error, it will jump to the trap and then just continue to the next VM in the array.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-1139</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 03 Dec 2008 12:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-1139</guid>
		<description>Allow me to translate that error. It says it cannot call the method Split (as indicated by the &lt;&lt;&lt;&lt;) on the object $VM.HardDisks[1].FileName because it is empty. This is true, because the $VM.Harddisks array only contains one object, referenced by $VM.HardDisks[0]. The result is that the output for disk 2 and 3 will be empty.
If your script stops when encountering an error, add the following line to the start of the script (to tell the script to report the error, but continue to run):
$errorActionPreference = &quot;Continue&quot;</description>
		<content:encoded><![CDATA[<p>Allow me to translate that error. It says it cannot call the method Split (as indicated by the <<<<) on the object $VM.HardDisks[1].FileName because it is empty. This is true, because the $VM.Harddisks array only contains one object, referenced by $VM.HardDisks[0]. The result is that the output for disk 2 and 3 will be empty.<br />
If your script stops when encountering an error, add the following line to the start of the script (to tell the script to report the error, but continue to run):<br />
$errorActionPreference = &#8220;Continue&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-1138</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 03 Dec 2008 12:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-1138</guid>
		<description>ok so if your Vm&#039;s only have one disk then you get the following error
You cannot call a method on a null-valued expression.
At :line:13 char:54
+ 	$myObj.Disk2Folder = $VM.HardDisks[1].FileName.Split( &lt;&lt;&lt;&lt; &quot; /.&quot;)[1]
if i take these lines out the script reports the correct infomation</description>
		<content:encoded><![CDATA[<p>ok so if your Vm&#8217;s only have one disk then you get the following error<br />
You cannot call a method on a null-valued expression.<br />
At :line:13 char:54<br />
+ 	$myObj.Disk2Folder = $VM.HardDisks[1].FileName.Split( &lt;&lt;&lt;&lt; &#8221; /.&#8221;)[1]<br />
if i take these lines out the script reports the correct infomation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-1120</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 02 Dec 2008 07:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-1120</guid>
		<description>Take a look at (Get-VM vm1).Guest and it&#039;s subproperties. If they are empty, the vm was powered down, or the VMware Tools were not running.</description>
		<content:encoded><![CDATA[<p>Take a look at (Get-VM vm1).Guest and it&#8217;s subproperties. If they are empty, the vm was powered down, or the <a href="http://www.vmware.com/" target='_blank'>VMware</a> Tools were not running.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-1111</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 01 Dec 2008 12:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-1111</guid>
		<description>i get the same error as brianRTS - looks like get-vm is only populated by the following info ?.

ps1&gt; get-vm vm1
Name                 PowerState Num CPUs Memory (MB)
----                 ---------- -------- -----------
vm1          PoweredOn  1        4096</description>
		<content:encoded><![CDATA[<p>i get the same error as brianRTS &#8211; looks like get-vm is only populated by the following info ?.</p>
<p>ps1&gt; get-vm vm1<br />
Name                 PowerState Num CPUs Memory (MB)<br />
&#8212;-                 &#8212;&#8212;&#8212;- &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8211;<br />
vm1          PoweredOn  1        4096</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oneliner of the day &#124; PeetersOnline.nl</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-383</link>
		<dc:creator>Oneliner of the day &#124; PeetersOnline.nl</dc:creator>
		<pubDate>Thu, 16 Oct 2008 13:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-383</guid>
		<description>[...] If you want more advanced description synching, check out the full script. [...]</description>
		<content:encoded><![CDATA[<p>[...] If you want more advanced description synching, check out the full script. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-219</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 09 Sep 2008 05:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-219</guid>
		<description>Hi ThomasV,

That would be a nice solution! Indeed less error-prone than editing files manually.

Thank you for your contribution.
Hugo</description>
		<content:encoded><![CDATA[<p>Hi ThomasV,</p>
<p>That would be a nice solution! Indeed less error-prone than editing files manually.</p>
<p>Thank you for your contribution.<br />
Hugo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasV</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-217</link>
		<dc:creator>ThomasV</dc:creator>
		<pubDate>Tue, 09 Sep 2008 05:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-217</guid>
		<description>Actually if you perform a storage vmotion, the resulting VM also is renamed and uses the VI inventory name (the one you see in the VI client) as the base for it&#039;s folder, vmx, vmdk files,... Without having to bring the machine down... Very error prone compared to editing the vmx and vmkfstool -e.</description>
		<content:encoded><![CDATA[<p>Actually if you perform a storage vmotion, the resulting VM also is renamed and uses the VI inventory name (the one you see in the VI client) as the base for it&#8217;s folder, vmx, vmdk files,&#8230; Without having to bring the machine down&#8230; Very error prone compared to editing the vmx and vmkfstool -e.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-185</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 02 Sep 2008 14:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-185</guid>
		<description>That error message indicates the $VM.Guest.HostName property is empty. I&#039;m guessing your VM is turned off or the VMware Tools are not installed.</description>
		<content:encoded><![CDATA[<p>That error message indicates the $VM.Guest.HostName property is empty. I&#8217;m guessing your VM is turned off or the <a href="http://www.vmware.com/" target='_blank'>VMware</a> Tools are not installed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BrianRTS</title>
		<link>http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/comment-page-1/#comment-184</link>
		<dc:creator>BrianRTS</dc:creator>
		<pubDate>Tue, 02 Sep 2008 14:25:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/are-your-names-in-sync-helpful-script-of-the-day/#comment-184</guid>
		<description>I get this error when running the script against the GA VItoolkit...

You cannot call a method on a null-valued expression.
At line 12, position 45
	$myObj.HostName = $VM.Guest.HostName.Split(&quot;.&quot;)[0].ToUpper()</description>
		<content:encoded><![CDATA[<p>I get this error when running the script against the GA VItoolkit&#8230;</p>
<p>You cannot call a method on a null-valued expression.<br />
At line 12, position 45<br />
	$myObj.HostName = $VM.Guest.HostName.Split(&#8220;.&#8221;)[0].ToUpper()</p>
]]></content:encoded>
	</item>
</channel>
</rss>
