<?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: Tip: Passing Parameters</title>
	<atom:link href="http://blog.usepowershell.com/2009/03/tip-passing-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.usepowershell.com/2009/03/tip-passing-parameters/</link>
	<description>The Shell Is Calling</description>
	<lastBuildDate>Tue, 10 Jan 2012 04:24:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Brian.Christiansen</title>
		<link>http://blog.usepowershell.com/2009/03/tip-passing-parameters/comment-page-1/#comment-950</link>
		<dc:creator>Brian.Christiansen</dc:creator>
		<pubDate>Fri, 11 Nov 2011 05:20:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/2009/03/tip-passing-parameters/#comment-950</guid>
		<description>Thanks for the tip about &quot;Passing Parameters&quot; One of the points raised in the post was about passing a text datatype parameter to a procedure called in the background and the fact that the contents of the text variable are lost. The same code called in the foreground works at both parameters are being passed as one is that PowerShell does not use the parens “()” to enclose parameters (that is only method calls from objects).Thanks Steven Murawski.</description>
		<content:encoded><![CDATA[<p>Thanks for the tip about &#8220;Passing Parameters&#8221; One of the points raised in the post was about passing a text datatype parameter to a procedure called in the background and the fact that the contents of the text variable are lost. The same code called in the foreground works at both parameters are being passed as one is that PowerShell does not use the parens “()” to enclose parameters (that is only method calls from objects).Thanks Steven Murawski.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Murawski</title>
		<link>http://blog.usepowershell.com/2009/03/tip-passing-parameters/comment-page-1/#comment-140</link>
		<dc:creator>Steven Murawski</dc:creator>
		<pubDate>Tue, 04 Aug 2009 15:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/2009/03/tip-passing-parameters/#comment-140</guid>
		<description>Orlando,
The reason that both parameters are being passed as one is that PowerShell does not use the parens &quot;()&quot; to enclose parameters (that is only method calls from objects).  Your function is only seeing one parameter being passed - an array containing $result and $logPreInstall.  
Try changing your function call to 
WriteVerifyLog $result $logPreInstall
and you should see the desired results.</description>
		<content:encoded><![CDATA[<p>Orlando,<br />
The reason that both parameters are being passed as one is that PowerShell does not use the parens &#8220;()&#8221; to enclose parameters (that is only method calls from objects).  Your function is only seeing one parameter being passed &#8211; an array containing $result and $logPreInstall.<br />
Try changing your function call to<br />
WriteVerifyLog $result $logPreInstall<br />
and you should see the desired results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: orlando</title>
		<link>http://blog.usepowershell.com/2009/03/tip-passing-parameters/comment-page-1/#comment-139</link>
		<dc:creator>orlando</dc:creator>
		<pubDate>Tue, 04 Aug 2009 14:31:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.usepowershell.com/2009/03/tip-passing-parameters/#comment-139</guid>
		<description>HI, I have a question regarding passing the parameters to a function like this:
function WriteVerifyLog($message, $logFile){
          [string]$m=$message;
               if ($m.contains(&#039;successfully&#039;)) {continue}
    else{
            Add-Content -Value $message -Path $LogFile;
         }   
        
}

when I call the function: 
WriteVerifyLog($result, $logPreInstall);
draws my attention that $message contains both the value of  $result AND $logPreInstall. I don&#039;t know what&#039;s the reason, and I like to ask your feedback on that. I&#039;d expect that $logFile would take the value of $logPreInstall. what am I doing wrong? Thanks in advance for the reply.</description>
		<content:encoded><![CDATA[<p>HI, I have a question regarding passing the parameters to a function like this:<br />
function WriteVerifyLog($message, $logFile){<br />
          [string]$m=$message;<br />
               if ($m.contains(&#8216;successfully&#8217;)) {continue}<br />
    else{<br />
            Add-Content -Value $message -Path $LogFile;<br />
         }   </p>
<p>}</p>
<p>when I call the function:<br />
WriteVerifyLog($result, $logPreInstall);<br />
draws my attention that $message contains both the value of  $result AND $logPreInstall. I don&#8217;t know what&#8217;s the reason, and I like to ask your feedback on that. I&#8217;d expect that $logFile would take the value of $logPreInstall. what am I doing wrong? Thanks in advance for the reply.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

