<?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: Exploring the .NET Framework with PowerShell &#8211; Calling a Method (Part 2a)</title>
	<atom:link href="http://blog.usepowershell.com/2009/02/exploring-the-net-framework-with-powershell-calling-a-method-part-2a/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.usepowershell.com/2009/02/exploring-the-net-framework-with-powershell-calling-a-method-part-2a/</link>
	<description>Real Admins Script</description>
	<lastBuildDate>Thu, 09 Sep 2010 07:35:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: John Middleton</title>
		<link>http://blog.usepowershell.com/2009/02/exploring-the-net-framework-with-powershell-calling-a-method-part-2a/comment-page-1/#comment-99</link>
		<dc:creator>John Middleton</dc:creator>
		<pubDate>Thu, 04 Jun 2009 17:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/?p=38#comment-99</guid>
		<description>Well, when the &#039;Where-Object&#039; piece is added it does not return any values..

Here is what I have that works:

$colComputers = get-content &quot;C:\servers.txt&quot;
foreach ($strComputer in $colComputers)
{

$ping = new-object System.Net.NetworkInformation.Ping
Write-Host Checking server: $strComputer
$Response = $ping.send($strComputer) &#124; Select-Object -Property Address  
$Response

}

But when Where-Object is used I get no IP&#039;s returned..?
 Where-Object { $_.Address -match &#039;10\.223\.42\.[1-254]&#039; }</description>
		<content:encoded><![CDATA[<p>Well, when the &#8216;Where-Object&#8217; piece is added it does not return any values..</p>
<p>Here is what I have that works:</p>
<p>$colComputers = get-content &#8220;C:\servers.txt&#8221;<br />
foreach ($strComputer in $colComputers)<br />
{</p>
<p>$ping = new-object System.Net.NetworkInformation.Ping<br />
Write-Host Checking server: $strComputer<br />
$Response = $ping.send($strComputer) | Select-Object -Property Address<br />
$Response</p>
<p>}</p>
<p>But when Where-Object is used I get no IP&#8217;s returned..?<br />
 Where-Object { $_.Address -match &#8217;10\.223\.42\.[1-254]&#8216; }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Murawski</title>
		<link>http://blog.usepowershell.com/2009/02/exploring-the-net-framework-with-powershell-calling-a-method-part-2a/comment-page-1/#comment-98</link>
		<dc:creator>Steven Murawski</dc:creator>
		<pubDate>Thu, 04 Jun 2009 16:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/?p=38#comment-98</guid>
		<description>To filter, we can use Where-Object.
&#039;Server1&#039;, &#039;Server2&#039;, &#039;Server3&#039; &#124; Foreach-Object { $ping.Send($_ } &#124; Where-Object { $_.Address -match &#039;192\.168\.10\.[1-254]&#039; } &#124; Select-Object -Property address, status
Or the shorter version
&#039;Server1&#039;, &#039;Server2&#039;, &#039;Server3&#039; &#124; % { $ping.Send($_ } &#124; ? { $_.Address -match &#039;192\.168\.10\.[1-254]&#039; } &#124; Select address, status</description>
		<content:encoded><![CDATA[<p>To filter, we can use Where-Object.<br />
&#8216;Server1&#8242;, &#8216;Server2&#8242;, &#8216;Server3&#8242; | Foreach-Object { $ping.Send($_ } | Where-Object { $_.Address -match &#8217;192\.168\.10\.[1-254]&#8216; } | Select-Object -Property address, status<br />
Or the shorter version<br />
&#8216;Server1&#8242;, &#8216;Server2&#8242;, &#8216;Server3&#8242; | % { $ping.Send($_ } | ? { $_.Address -match &#8217;192\.168\.10\.[1-254]&#8216; } | Select address, status</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Middleton</title>
		<link>http://blog.usepowershell.com/2009/02/exploring-the-net-framework-with-powershell-calling-a-method-part-2a/comment-page-1/#comment-97</link>
		<dc:creator>John Middleton</dc:creator>
		<pubDate>Thu, 04 Jun 2009 14:59:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/?p=38#comment-97</guid>
		<description>Excellent.. the &#039;Select-Object&#039; addition worked... just need to figure how to filter out just certain IP range next.

Thank you !</description>
		<content:encoded><![CDATA[<p>Excellent.. the &#8216;Select-Object&#8217; addition worked&#8230; just need to figure how to filter out just certain IP range next.</p>
<p>Thank you !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Murawski</title>
		<link>http://blog.usepowershell.com/2009/02/exploring-the-net-framework-with-powershell-calling-a-method-part-2a/comment-page-1/#comment-96</link>
		<dc:creator>Steven Murawski</dc:creator>
		<pubDate>Thu, 04 Jun 2009 00:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/?p=38#comment-96</guid>
		<description>I would do something like:
$ping.Send(&#039;google.com&#039;) &#124; Select-Object -Property Status, Address
( or the shorter form $ping.Send(&#039;google.com&#039;) &#124; select status, address )</description>
		<content:encoded><![CDATA[<p>I would do something like:<br />
$ping.Send(&#8216;google.com&#8217;) | Select-Object -Property Status, Address<br />
( or the shorter form $ping.Send(&#8216;google.com&#8217;) | select status, address )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Middleton</title>
		<link>http://blog.usepowershell.com/2009/02/exploring-the-net-framework-with-powershell-calling-a-method-part-2a/comment-page-1/#comment-92</link>
		<dc:creator>John Middleton</dc:creator>
		<pubDate>Wed, 03 Jun 2009 18:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/?p=38#comment-92</guid>
		<description>Excellent article.. one question.. how can we filter this .NET ping script to return only the items wanted.. i.e. Status and IP address..?</description>
		<content:encoded><![CDATA[<p>Excellent article.. one question.. how can we filter this .NET ping script to return only the items wanted.. i.e. Status and IP address..?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
