<?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: PowerShell One-Liner: Get-PrimaryIPAddress</title>
	<atom:link href="http://halr9000.com/article/829/feed" rel="self" type="application/rss+xml" />
	<link>http://halr9000.com/article/829</link>
	<description>(powershell &#38; other stuff)</description>
	<lastBuildDate>Thu, 18 Mar 2010 14:11:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Brad Ascar</title>
		<link>http://halr9000.com/article/829/comment-page-1#comment-7382</link>
		<dc:creator>Brad Ascar</dc:creator>
		<pubDate>Wed, 14 Oct 2009 13:21:15 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/829#comment-7382</guid>
		<description>No IPV6 configured and no output from Glenn&#039;s script.</description>
		<content:encoded><![CDATA[<p>No IPV6 configured and no output from Glenn&#8217;s script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: halr9000</title>
		<link>http://halr9000.com/article/829/comment-page-1#comment-7381</link>
		<dc:creator>halr9000</dc:creator>
		<pubDate>Wed, 14 Oct 2009 12:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/829#comment-7381</guid>
		<description>Brad, Glenn&#039;s version doesn&#039;t work? I suspect that you&#039;ve got IPV6 enabled, right?</description>
		<content:encoded><![CDATA[<p>Brad, Glenn&#8217;s version doesn&#8217;t work? I suspect that you&#8217;ve got IPV6 enabled, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Ascar</title>
		<link>http://halr9000.com/article/829/comment-page-1#comment-7379</link>
		<dc:creator>Brad Ascar</dc:creator>
		<pubDate>Wed, 14 Oct 2009 12:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/829#comment-7379</guid>
		<description>I ran into an issue with the .NET part.  The first example runs fine for me, but on 2 different systems I have I got the following when running the second method:

Method invocation failed because [System.Object[]] doesn&#039;t contain a method named &#039;GetIPProperties&#039;.
At :line:3 char:27
+ $PrimaryNIC.GetIPProperties &lt;&lt;&lt;&lt; ().UnicastAddresses[0].Address.IPAddressToString


if I replace your last line with:

foreach ($nic in $PrimaryNIC){
$nic.GetIPProperties()
}

I get: 

Object reference not set to an instance of an object.
At :line:0 char:0

I have attempted some debugging of my own but have run to the end of my knowledge of PowerShell.</description>
		<content:encoded><![CDATA[<p>I ran into an issue with the .NET part.  The first example runs fine for me, but on 2 different systems I have I got the following when running the second method:</p>
<p>Method invocation failed because [System.Object[]] doesn&#8217;t contain a method named &#8216;GetIPProperties&#8217;.<br />
At :line:3 char:27<br />
+ $PrimaryNIC.GetIPProperties &lt;&lt;&lt;&lt; ().UnicastAddresses[0].Address.IPAddressToString</p>
<p>if I replace your last line with:</p>
<p>foreach ($nic in $PrimaryNIC){<br />
$nic.GetIPProperties()<br />
}</p>
<p>I get: </p>
<p>Object reference not set to an instance of an object.<br />
At :line:0 char:0</p>
<p>I have attempted some debugging of my own but have run to the end of my knowledge of PowerShell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Sizemore</title>
		<link>http://halr9000.com/article/829/comment-page-1#comment-7363</link>
		<dc:creator>Glenn Sizemore</dc:creator>
		<pubDate>Sat, 10 Oct 2009 03:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/829#comment-7363</guid>
		<description>You could keep it as a oneliner ;)

PS&gt;[system.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() &#124;
    Where-Object {$_.GetIPProperties().GatewayAddresses} &#124; 
    ForEach-Object {$_.GetIPProperties().UnicastAddresses&#124;
        Foreach-object{$_.Address.IPAddressToString}
    }

I added the second foreach loop b/c my systems have both an IPv4 &amp; IPv6 address

~Glenn</description>
		<content:encoded><![CDATA[<p>You could keep it as a oneliner <img src='http://halr9000.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>PS&gt;[system.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() |<br />
    Where-Object {$_.GetIPProperties().GatewayAddresses} |<br />
    ForEach-Object {$_.GetIPProperties().UnicastAddresses|<br />
        Foreach-object{$_.Address.IPAddressToString}<br />
    }</p>
<p>I added the second foreach loop b/c my systems have both an IPv4 &amp; IPv6 address</p>
<p>~Glenn</p>
]]></content:encoded>
	</item>
</channel>
</rss>
