<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: About</title>
	<atom:link href="http://poshoholic.com/about/feed/" rel="self" type="application/rss+xml" />
	<link>http://poshoholic.com</link>
	<description>Totally addicted to PowerShell</description>
	<lastBuildDate>Sat, 05 May 2012 13:03:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: arnaud</title>
		<link>http://poshoholic.com/about/#comment-2188</link>
		<dc:creator><![CDATA[arnaud]]></dc:creator>
		<pubDate>Tue, 11 Jan 2011 09:18:21 +0000</pubDate>
		<guid isPermaLink="false">#comment-2188</guid>
		<description><![CDATA[superb !]]></description>
		<content:encoded><![CDATA[<p>superb !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kirk Munro</title>
		<link>http://poshoholic.com/about/#comment-2181</link>
		<dc:creator><![CDATA[Kirk Munro]]></dc:creator>
		<pubDate>Mon, 10 Jan 2011 14:35:36 +0000</pubDate>
		<guid isPermaLink="false">#comment-2181</guid>
		<description><![CDATA[You need to be aware that there are two types of errors in PowerShell: terminating errors and non-terminating errors.

Terminating errors are errors that result in an exception being raised.  When an exception is raised the current script block will immediately stop.  Those errors are the kinds of errors that are caught using the catch part of the try/catch statement.  An example of a terminating error is if you divide by something by 0.  i.e. if you run this script block:

&lt;code&gt;
{
    1 / (1-1)
    &#039;This will never execute&#039;
}
&lt;/code&gt;

you will never see the &#039;This will never execute&#039; string because the script terminates when it attempts to divide a value by zero.

Non-terminating errors are errors that do not cause a script to terminate.  These types of errors are not catchable using try/catch statements unless you specifically tell PowerShell that you want them to be treated as terminating errors.  For example, consider this script block:

&lt;code&gt;
{
    Get-Command -Invalid Value
    &#039;Hello&#039;
}
&lt;/code&gt;

If you did not want the second command to execute if the first command returns an error you would either have to add &quot;-ErrorAction Stop&quot; to the end of the first command (instructing PowerShell to treat errors from that command as terminating errors) or you would have to insert &quot;$ErrorActionPreference = &#039;Stop&#039;&quot; before the first command (instructing PowerShell to treat all errors in that script block as terminating errors).  Either of these will allow you to catch those errors in the catch portion of your try/catch statement.  The only other alternative is to specifically check to see if a command raised an error or not, like this:

&lt;code&gt;
{
    Get-Command -Invalid Value
    if ($?) {
        &#039;Hello&#039;
    }
}
&lt;/code&gt;


Hope this helps.]]></description>
		<content:encoded><![CDATA[<p>You need to be aware that there are two types of errors in PowerShell: terminating errors and non-terminating errors.</p>
<p>Terminating errors are errors that result in an exception being raised.  When an exception is raised the current script block will immediately stop.  Those errors are the kinds of errors that are caught using the catch part of the try/catch statement.  An example of a terminating error is if you divide by something by 0.  i.e. if you run this script block:</p>
<p><code><br />
{<br />
    1 / (1-1)<br />
    'This will never execute'<br />
}<br />
</code></p>
<p>you will never see the &#8216;This will never execute&#8217; string because the script terminates when it attempts to divide a value by zero.</p>
<p>Non-terminating errors are errors that do not cause a script to terminate.  These types of errors are not catchable using try/catch statements unless you specifically tell PowerShell that you want them to be treated as terminating errors.  For example, consider this script block:</p>
<p><code><br />
{<br />
    Get-Command -Invalid Value<br />
    'Hello'<br />
}<br />
</code></p>
<p>If you did not want the second command to execute if the first command returns an error you would either have to add &#8220;-ErrorAction Stop&#8221; to the end of the first command (instructing PowerShell to treat errors from that command as terminating errors) or you would have to insert &#8220;$ErrorActionPreference = &#8216;Stop&#8217;&#8221; before the first command (instructing PowerShell to treat all errors in that script block as terminating errors).  Either of these will allow you to catch those errors in the catch portion of your try/catch statement.  The only other alternative is to specifically check to see if a command raised an error or not, like this:</p>
<p><code><br />
{<br />
    Get-Command -Invalid Value<br />
    if ($?) {<br />
        'Hello'<br />
    }<br />
}<br />
</code></p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arnaud</title>
		<link>http://poshoholic.com/about/#comment-2179</link>
		<dc:creator><![CDATA[arnaud]]></dc:creator>
		<pubDate>Mon, 10 Jan 2011 09:08:30 +0000</pubDate>
		<guid isPermaLink="false">#comment-2179</guid>
		<description><![CDATA[hello,

many thanks

Another question. I tried the error handler with the try catch block. if we have 2  command in the try block,and the first command in try generates an error, process execute the block catch but execute after the 2 command.

Should there be a specific process to go into catch block and not execute next command in block try?


try{

command 1
command 2

}catch{
write host ...

}]]></description>
		<content:encoded><![CDATA[<p>hello,</p>
<p>many thanks</p>
<p>Another question. I tried the error handler with the try catch block. if we have 2  command in the try block,and the first command in try generates an error, process execute the block catch but execute after the 2 command.</p>
<p>Should there be a specific process to go into catch block and not execute next command in block try?</p>
<p>try{</p>
<p>command 1<br />
command 2</p>
<p>}catch{<br />
write host &#8230;</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kirk Munro</title>
		<link>http://poshoholic.com/about/#comment-2168</link>
		<dc:creator><![CDATA[Kirk Munro]]></dc:creator>
		<pubDate>Wed, 05 Jan 2011 14:07:50 +0000</pubDate>
		<guid isPermaLink="false">#comment-2168</guid>
		<description><![CDATA[Hi Arnaud,

The reason your parameters are being treated as part of the array is because of the commas you use between them.  In many programming languages, commas are used to separate parameters in function calls.  This is not the case for PowerShell.  You can separate parameters with spaces, or you can pass in the parameters by name.  Also switch parameters are not the same as boolean parameters.  If you want them, you include the switch.  If you don&#039;t, you simply leave it out.  For the New-LocalUser function, with the values you have specified, you would do this:

$password = ConvertTo-SecureString -String passwordUser -AsPlainText -Force
New-LocalUser -Name @(&#039;A&#039;) -Password $password -FullName &#039;FullName 102&#039; -Description &#039;Description 102&#039; -PasswordNeverExpires -ComputerName @(&#039;RDN5V197&#039;) -Credential administrateur

This will prompt you for a password for your administrateur account when you run it.  If you don&#039;t want the prompt, you could replace administrateur with $TempCredential as you have in your example script.

I hope this helps.  Let me know if you have any additional questions.

Kirk out.]]></description>
		<content:encoded><![CDATA[<p>Hi Arnaud,</p>
<p>The reason your parameters are being treated as part of the array is because of the commas you use between them.  In many programming languages, commas are used to separate parameters in function calls.  This is not the case for PowerShell.  You can separate parameters with spaces, or you can pass in the parameters by name.  Also switch parameters are not the same as boolean parameters.  If you want them, you include the switch.  If you don&#8217;t, you simply leave it out.  For the New-LocalUser function, with the values you have specified, you would do this:</p>
<p>$password = ConvertTo-SecureString -String passwordUser -AsPlainText -Force<br />
New-LocalUser -Name @(&#8216;A&#8217;) -Password $password -FullName &#8216;FullName 102&#8242; -Description &#8216;Description 102&#8242; -PasswordNeverExpires -ComputerName @(&#8216;RDN5V197&#8242;) -Credential administrateur</p>
<p>This will prompt you for a password for your administrateur account when you run it.  If you don&#8217;t want the prompt, you could replace administrateur with $TempCredential as you have in your example script.</p>
<p>I hope this helps.  Let me know if you have any additional questions.</p>
<p>Kirk out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arnaud</title>
		<link>http://poshoholic.com/about/#comment-2165</link>
		<dc:creator><![CDATA[arnaud]]></dc:creator>
		<pubDate>Tue, 04 Jan 2011 18:08:22 +0000</pubDate>
		<guid isPermaLink="false">#comment-2165</guid>
		<description><![CDATA[hi 

i use function New-LocalUser from your Network.powerpack. Very nice code !!

however, when i call it, the first parameter which is a string array of users ( i think), has the value &quot;A,&quot;&quot;,FullName 102,description 102, ,&quot;False&quot; ,&quot;False&quot; ,&quot;True&quot;, &quot;False&quot;, @(&quot;RDN5V197&quot;),  $null&quot;, corresponding to all the parameters.

i call it with the following way : 

$password = &quot;mypassword&quot;  -asSecureString
$tempCredential = New-Object System.Management.Automation.PsCredential “administrateur”,$password
$password = $tempCredential.GetNetworkCredential().Password



New-LocalUser @(&quot;A&quot;),&quot;passwordUser&quot; , &quot;FullName 102&quot;, &quot;description 102&quot; ,&quot;False&quot; ,&quot;False&quot; ,&quot;True&quot;, &quot;False&quot;, @(&quot;RDN5V197&quot;),  $tempCredential 







is it possible for you to answer me with an exemple call of this function ?]]></description>
		<content:encoded><![CDATA[<p>hi </p>
<p>i use function New-LocalUser from your Network.powerpack. Very nice code !!</p>
<p>however, when i call it, the first parameter which is a string array of users ( i think), has the value &#8220;A,&#8221;",FullName 102,description 102, ,&#8221;False&#8221; ,&#8221;False&#8221; ,&#8221;True&#8221;, &#8220;False&#8221;, @(&#8220;RDN5V197&#8243;),  $null&#8221;, corresponding to all the parameters.</p>
<p>i call it with the following way : </p>
<p>$password = &#8220;mypassword&#8221;  -asSecureString<br />
$tempCredential = New-Object System.Management.Automation.PsCredential “administrateur”,$password<br />
$password = $tempCredential.GetNetworkCredential().Password</p>
<p>New-LocalUser @(&#8220;A&#8221;),&#8221;passwordUser&#8221; , &#8220;FullName 102&#8243;, &#8220;description 102&#8243; ,&#8221;False&#8221; ,&#8221;False&#8221; ,&#8221;True&#8221;, &#8220;False&#8221;, @(&#8220;RDN5V197&#8243;),  $tempCredential </p>
<p>is it possible for you to answer me with an exemple call of this function ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VMware Infrastructure PowerPack 2.1 released &#171; Poshoholic</title>
		<link>http://poshoholic.com/about/#comment-924</link>
		<dc:creator><![CDATA[VMware Infrastructure PowerPack 2.1 released &#171; Poshoholic]]></dc:creator>
		<pubDate>Mon, 02 Feb 2009 04:55:15 +0000</pubDate>
		<guid isPermaLink="false">#comment-924</guid>
		<description><![CDATA[[...] About  &#160; [...]]]></description>
		<content:encoded><![CDATA[<p>[...] About  &nbsp; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VMware Infrastructure PowerPack 2.0 is now available &#171; Poshoholic</title>
		<link>http://poshoholic.com/about/#comment-897</link>
		<dc:creator><![CDATA[VMware Infrastructure PowerPack 2.0 is now available &#171; Poshoholic]]></dc:creator>
		<pubDate>Fri, 19 Dec 2008 22:41:47 +0000</pubDate>
		<guid isPermaLink="false">#comment-897</guid>
		<description><![CDATA[[...] About  &#160; [...]]]></description>
		<content:encoded><![CDATA[<p>[...] About  &nbsp; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hyper-V PowerPack Updated &#171; Poshoholic</title>
		<link>http://poshoholic.com/about/#comment-883</link>
		<dc:creator><![CDATA[Hyper-V PowerPack Updated &#171; Poshoholic]]></dc:creator>
		<pubDate>Sun, 16 Nov 2008 19:14:11 +0000</pubDate>
		<guid isPermaLink="false">#comment-883</guid>
		<description><![CDATA[[...] About  &#160; [...]]]></description>
		<content:encoded><![CDATA[<p>[...] About  &nbsp; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Use PowerGUI to manage SQL Server 2008 &#171; Poshoholic</title>
		<link>http://poshoholic.com/about/#comment-754</link>
		<dc:creator><![CDATA[Use PowerGUI to manage SQL Server 2008 &#171; Poshoholic]]></dc:creator>
		<pubDate>Sat, 03 May 2008 06:40:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-754</guid>
		<description><![CDATA[[...] About  &#160; [...]]]></description>
		<content:encoded><![CDATA[<p>[...] About  &nbsp; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to create a PowerPack &#171; Poshoholic</title>
		<link>http://poshoholic.com/about/#comment-753</link>
		<dc:creator><![CDATA[How to create a PowerPack &#171; Poshoholic]]></dc:creator>
		<pubDate>Wed, 30 Apr 2008 23:22:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-753</guid>
		<description><![CDATA[[...] About  &#160; [...]]]></description>
		<content:encoded><![CDATA[<p>[...] About  &nbsp; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Dickins</title>
		<link>http://poshoholic.com/about/#comment-259</link>
		<dc:creator><![CDATA[Paul Dickins]]></dc:creator>
		<pubDate>Tue, 27 Nov 2007 04:04:22 +0000</pubDate>
		<guid isPermaLink="false">#comment-259</guid>
		<description><![CDATA[Hello,
Nothing whatsoever to do with PowerShell except that at the seminar recently at OWSUG there were, in your exposition, many references to JK Rowling characters. My preference would be for HDM by Philip Pullman. This trilogy is, for me,  better written and my 11 year old read the whole lot, which was a wonder. Better still, now that the first volume has been filmed, the  Church is wanting the books removed from libraries. This in Ontario. Hollow laughter, but congratulations for an interesting evening.]]></description>
		<content:encoded><![CDATA[<p>Hello,<br />
Nothing whatsoever to do with PowerShell except that at the seminar recently at OWSUG there were, in your exposition, many references to JK Rowling characters. My preference would be for HDM by Philip Pullman. This trilogy is, for me,  better written and my 11 year old read the whole lot, which was a wonder. Better still, now that the first volume has been filmed, the  Church is wanting the books removed from libraries. This in Ontario. Hollow laughter, but congratulations for an interesting evening.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kirk Munro</title>
		<link>http://poshoholic.com/about/#comment-59</link>
		<dc:creator><![CDATA[Kirk Munro]]></dc:creator>
		<pubDate>Thu, 18 Oct 2007 19:59:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-59</guid>
		<description><![CDATA[I am Canadian!  Living in Ottawa, Ontario at the moment, but I was born a Maritimer and spent most of my life in the Halifax /Dartmouth area.]]></description>
		<content:encoded><![CDATA[<p>I am Canadian!  Living in Ottawa, Ontario at the moment, but I was born a Maritimer and spent most of my life in the Halifax /Dartmouth area.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Shaw</title>
		<link>http://poshoholic.com/about/#comment-58</link>
		<dc:creator><![CDATA[Marco Shaw]]></dc:creator>
		<pubDate>Thu, 18 Oct 2007 18:28:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-58</guid>
		<description><![CDATA[Hey!  Are you Canadian?

Marco]]></description>
		<content:encoded><![CDATA[<p>Hey!  Are you Canadian?</p>
<p>Marco</p>
]]></content:encoded>
	</item>
</channel>
</rss>

