<?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: Name that hardware	</title>
	<atom:link href="https://www.lucd.info/2010/03/07/name-that-hardware/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lucd.info/2010/03/07/name-that-hardware/</link>
	<description>My PowerShell ramblings</description>
	<lastBuildDate>Wed, 08 Apr 2020 10:24:08 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.11</generator>
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-577</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Fri, 25 Jun 2010 01:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-577</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2010/03/07/name-that-hardware/#comment-571&quot;&gt;Chakrit&lt;/a&gt;.

Thanks.
The default view cuts of some properties to make them all fit on a console line (typically 80 chars).
And since the &quot;&#062;&quot; operator redirects the console output, you will see the same in your file
Use the Out-File cmdlet instead. Like this (last line of the script)
&lt;code&gt;} &#124; Out-File &quot;C:\HW.txt&quot;
&lt;/code&gt;
And if you want columns that have less blanks between them, you can use the -AutoSize parameter of the Format-Table cmdlet.
Like this
&lt;code&gt;} &#124; ft -AutoSize &#124; Out-File &quot;C:\hw.txt&quot;
&lt;/code&gt;]]></description>
			<content:encoded><![CDATA[<p>Thanks.<br />
The default view cuts of some properties to make them all fit on a console line (typically 80 chars).<br />
And since the &#8220;&gt;&#8221; operator redirects the console output, you will see the same in your file<br />
Use the Out-File cmdlet instead. Like this (last line of the script)<br />
<code>} | Out-File "C:\HW.txt"<br />
</code><br />
And if you want columns that have less blanks between them, you can use the -AutoSize parameter of the Format-Table cmdlet.<br />
Like this<br />
<code>} | ft -AutoSize | Out-File "C:\hw.txt"<br />
</code></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Chakrit		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-571</link>

		<dc:creator><![CDATA[Chakrit]]></dc:creator>
		<pubDate>Thu, 24 Jun 2010 12:09:40 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-571</guid>

					<description><![CDATA[Brilliant Script! Though the long output comes out as &quot;...&quot;. I&#039;m not sure how to expand this as I just redirect the output &quot;&#062;&quot; to a .txt file. Many thanks!]]></description>
			<content:encoded><![CDATA[<p>Brilliant Script! Though the long output comes out as &#8220;&#8230;&#8221;. I&#8217;m not sure how to expand this as I just redirect the output &#8220;&gt;&#8221; to a .txt file. Many thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-455</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Wed, 21 Apr 2010 17:58:35 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-455</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2010/03/07/name-that-hardware/#comment-454&quot;&gt;Matt B.&lt;/a&gt;.

Hi Matt,
Did you copy the code with the 2nd icon at the top right ?
These icons appear when you hover over the box that contains the code.

From the error message it looks as if the code is not complete for that statement.
Luc.]]></description>
			<content:encoded><![CDATA[<p>Hi Matt,<br />
Did you copy the code with the 2nd icon at the top right ?<br />
These icons appear when you hover over the box that contains the code.</p>
<p>From the error message it looks as if the code is not complete for that statement.<br />
Luc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matt B.		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-454</link>

		<dc:creator><![CDATA[Matt B.]]></dc:creator>
		<pubDate>Wed, 21 Apr 2010 17:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-454</guid>

					<description><![CDATA[&lt;a href=&quot;#comment-453&quot; rel=&quot;nofollow&quot;&gt;@LucD &lt;/a&gt; 
Hi Luc.  I installed v2 RTM and tried again.  I got the following message repeatedly but I did get some output.  The 3 columns that did appear were Slot, Device and Vendor.  Device was blank.  Thanks for troubleshooting this with me.  Please let me know if I need to check anything else.

You cannot call a method on a null-valued expression.
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\NameThatHardware.ps1:48 char:63
+         Device = else{$strDeviceId}}
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull


Slot                                                                                Device
----                                                                                ------
00:00.0
00:01.0

I then switched out lines 45-49 with yours and got these messages. 
You cannot call a method on a null-valued expression.
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\NameThatHardware.ps1:48 char:67
+     $row.Device = else{$strDeviceId}}
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull


Slot                                                                                Vendor                                                                             Device
----                                                                                ------                                                                             ------
00:00.0                                                                             0x10DE
00:01.0                                                                             0x10DE]]></description>
			<content:encoded><![CDATA[<p><a href="#comment-453" rel="nofollow">@LucD </a><br />
Hi Luc.  I installed v2 RTM and tried again.  I got the following message repeatedly but I did get some output.  The 3 columns that did appear were Slot, Device and Vendor.  Device was blank.  Thanks for troubleshooting this with me.  Please let me know if I need to check anything else.</p>
<p>You cannot call a method on a null-valued expression.<br />
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\NameThatHardware.ps1:48 char:63<br />
+         Device = else{$strDeviceId}}<br />
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException<br />
    + FullyQualifiedErrorId : InvokeMethodOnNull</p>
<p>Slot                                                                                Device<br />
&#8212;-                                                                                &#8212;&#8212;<br />
00:00.0<br />
00:01.0</p>
<p>I then switched out lines 45-49 with yours and got these messages.<br />
You cannot call a method on a null-valued expression.<br />
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\NameThatHardware.ps1:48 char:67<br />
+     $row.Device = else{$strDeviceId}}<br />
    + CategoryInfo          : InvalidOperation: (ContainsKey:String) [], RuntimeException<br />
    + FullyQualifiedErrorId : InvokeMethodOnNull</p>
<p>Slot                                                                                Vendor                                                                             Device<br />
&#8212;-                                                                                &#8212;&#8212;                                                                             &#8212;&#8212;<br />
00:00.0                                                                             0x10DE<br />
00:01.0                                                                             0x10DE</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-453</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Tue, 20 Apr 2010 21:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-453</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2010/03/07/name-that-hardware/#comment-452&quot;&gt;Matt B.&lt;/a&gt;.

Hi Matt. It looks as if you&#039;re not running PowerShell v2 RTM.
You can use the script in Tobias&#039;s post called &lt;a href=&quot;https://powershell.com/cs/blogs/tobias/archive/2010/01/21/are-you-using-the-correct-powershell-version.aspx&quot; rel=&quot;nofollow&quot;&gt;Are you using the correct PowerShell version?&lt;/a&gt; to check what version you are running.

If for whatever reason you can&#039;t upgrade to PowerShell v2 RTM change lines 45-49 like this
&lt;code&gt;
$row = &quot;&quot; &#124; Select Slot, Vendor, Device
$row.Slot = $_.Id
$row.Vendor = &amp;{if($deviceTab.ContainsKey($strVendorId)){$deviceTab[$strVendorId].Vendor}else{$strVendorId}}
$row.Device = &amp;{if($deviceTab[$strVendorId].deviceTab.ContainsKey($strDeviceId)){$deviceTab[$strVendorId].deviceTab[$strDeviceId]}else{$strDeviceId}}
$row
&lt;/code&gt;]]></description>
			<content:encoded><![CDATA[<p>Hi Matt. It looks as if you&#8217;re not running PowerShell v2 RTM.<br />
You can use the script in Tobias&#8217;s post called <a href="https://powershell.com/cs/blogs/tobias/archive/2010/01/21/are-you-using-the-correct-powershell-version.aspx" rel="nofollow">Are you using the correct PowerShell version?</a> to check what version you are running.</p>
<p>If for whatever reason you can&#8217;t upgrade to PowerShell v2 RTM change lines 45-49 like this<br />
<code><br />
$row = "" | Select Slot, Vendor, Device<br />
$row.Slot = $_.Id<br />
$row.Vendor = &#038;{if($deviceTab.ContainsKey($strVendorId)){$deviceTab[$strVendorId].Vendor}else{$strVendorId}}<br />
$row.Device = &#038;{if($deviceTab[$strVendorId].deviceTab.ContainsKey($strDeviceId)){$deviceTab[$strVendorId].deviceTab[$strDeviceId]}else{$strDeviceId}}<br />
$row<br />
</code></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matt B.		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-452</link>

		<dc:creator><![CDATA[Matt B.]]></dc:creator>
		<pubDate>Tue, 20 Apr 2010 20:58:20 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-452</guid>

					<description><![CDATA[This script is exactly what I need.  For those of us new to PowerCLI, how do I properly run this?  I have installed the PowerCli, ran Set-ExecutionPolicy RemoteSigned once, used connect-viserver to connect to the ESX server, changed line 1 of the script to the ESX server name and ran the script as &quot;name that hardware.ps1&quot;.  I get the following error repeatedly.

+     New-Object PSObject -Property  &#060;&#060;&#060;&#060; @{
You cannot call a method on a null-valued expression.
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\name that hardware.ps1:48 char:63
+         Device = else{$strDeviceId}}
New-Object : A parameter cannot be found that matches parameter name &#039;Property&#039;.
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\name that hardware.ps1:45 char:31]]></description>
			<content:encoded><![CDATA[<p>This script is exactly what I need.  For those of us new to PowerCLI, how do I properly run this?  I have installed the PowerCli, ran Set-ExecutionPolicy RemoteSigned once, used connect-viserver to connect to the ESX server, changed line 1 of the script to the ESX server name and ran the script as &#8220;name that hardware.ps1&#8221;.  I get the following error repeatedly.</p>
<p>+     New-Object PSObject -Property  &lt;&lt;&lt;&lt; @{<br />
You cannot call a method on a null-valued expression.<br />
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\name that hardware.ps1:48 char:63<br />
+         Device = else{$strDeviceId}}<br />
New-Object : A parameter cannot be found that matches parameter name &#039;Property&#039;.<br />
At C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts\name that hardware.ps1:45 char:31</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Alan Renouf		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-370</link>

		<dc:creator><![CDATA[Alan Renouf]]></dc:creator>
		<pubDate>Mon, 08 Mar 2010 12:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-370</guid>

					<description><![CDATA[Brilliant stuff, if only I had this 3 weeks ago when the damn order monkeys couldnt remember what model of nic they ordered !

Amazing script (as always) Luc.]]></description>
			<content:encoded><![CDATA[<p>Brilliant stuff, if only I had this 3 weeks ago when the damn order monkeys couldnt remember what model of nic they ordered !</p>
<p>Amazing script (as always) Luc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: michael		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-369</link>

		<dc:creator><![CDATA[michael]]></dc:creator>
		<pubDate>Mon, 08 Mar 2010 10:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-369</guid>

					<description><![CDATA[cool script!
as usual.]]></description>
			<content:encoded><![CDATA[<p>cool script!<br />
as usual.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Robert van den Nieuwendijk		</title>
		<link>https://www.lucd.info/2010/03/07/name-that-hardware/#comment-367</link>

		<dc:creator><![CDATA[Robert van den Nieuwendijk]]></dc:creator>
		<pubDate>Sun, 07 Mar 2010 06:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://lucd.info/?p=1899#comment-367</guid>

					<description><![CDATA[Awesome script. Beautiful to see how you combine information from two different sources. And I love the hash table in a hash table technique.]]></description>
			<content:encoded><![CDATA[<p>Awesome script. Beautiful to see how you combine information from two different sources. And I love the hash table in a hash table technique.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
