<?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: Split-Job 0.93</title>
	<atom:link href="http://jansveld.net/powershell/?feed=rss2&#038;p=11" rel="self" type="application/rss+xml" />
	<link>http://jansveld.net/powershell/?p=11</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 07 Aug 2013 07:55:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6.1</generator>
	<item>
		<title>By: Arnoud Jansveld</title>
		<link>http://jansveld.net/powershell/?p=11#comment-576</link>
		<dc:creator>Arnoud Jansveld</dc:creator>
		<pubDate>Fri, 06 Jul 2012 00:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-576</guid>
		<description><![CDATA[You can pass local variables to your script with the Variable parameter; in your case you would use this:

get-content c:servers.txt &#124; split-job {myFunction -param2 $param2 -param3 $param3} &lt;strong&gt;-Variable param2,param3&lt;/strong&gt;

Regards,
Arnoud]]></description>
		<content:encoded><![CDATA[<p>You can pass local variables to your script with the Variable parameter; in your case you would use this:</p>
<p>get-content c:servers.txt | split-job {myFunction -param2 $param2 -param3 $param3} <strong>-Variable param2,param3</strong></p>
<p>Regards,<br />
Arnoud</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laerte Junior</title>
		<link>http://jansveld.net/powershell/?p=11#comment-575</link>
		<dc:creator>Laerte Junior</dc:creator>
		<pubDate>Thu, 05 Jul 2012 22:25:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-575</guid>
		<description><![CDATA[Hi Guys, I am trying to use with Multiple Parameters.

My function has 3 parameters, Server by pipeline and Param2 and Param 3

$Param2 = &quot;Something2&#039;
$param3 = &quot;Something3&quot;
get-content c:servers.txt &#124; split-job {myFunction -param2 $param2 -param3 $param3}

and looks like the Param2 and Param3 are not passing to my function.

Any ideas ? Thanks]]></description>
		<content:encoded><![CDATA[<p>Hi Guys, I am trying to use with Multiple Parameters.</p>
<p>My function has 3 parameters, Server by pipeline and Param2 and Param 3</p>
<p>$Param2 = &#8220;Something2&#8242;<br />
$param3 = &#8220;Something3&#8243;<br />
get-content c:servers.txt | split-job {myFunction -param2 $param2 -param3 $param3}</p>
<p>and looks like the Param2 and Param3 are not passing to my function.</p>
<p>Any ideas ? Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Part IV : Move Computers to OU based on IP Subnets</title>
		<link>http://jansveld.net/powershell/?p=11#comment-574</link>
		<dc:creator>Part IV : Move Computers to OU based on IP Subnets</dc:creator>
		<pubDate>Thu, 08 Dec 2011 14:31:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-574</guid>
		<description><![CDATA[[...] Split-Job : Used to speed up the script execution. So the script will execute 10 times faster. Credit goes to Arnoud Jansveld [...] ]]></description>
		<content:encoded><![CDATA[<p>[...] Split-Job : Used to speed up the script execution. So the script will execute 10 times faster. Credit goes to Arnoud Jansveld [...] </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bridging the GAP between AD, DNS, Sites, IP Subnets and SCCM using Powershell &#124; myITforum.com</title>
		<link>http://jansveld.net/powershell/?p=11#comment-573</link>
		<dc:creator>Bridging the GAP between AD, DNS, Sites, IP Subnets and SCCM using Powershell &#124; myITforum.com</dc:creator>
		<pubDate>Mon, 24 Oct 2011 20:15:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-573</guid>
		<description><![CDATA[[...] Split-Job : Used to speed up the script execution. So the script will execute 10 times faster. Credit goes to Arnoud Jansveld [...] ]]></description>
		<content:encoded><![CDATA[<p>[...] Split-Job : Used to speed up the script execution. So the script will execute 10 times faster. Credit goes to Arnoud Jansveld [...] </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Kmiec</title>
		<link>http://jansveld.net/powershell/?p=11#comment-572</link>
		<dc:creator>John Kmiec</dc:creator>
		<pubDate>Thu, 14 Jul 2011 15:24:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-572</guid>
		<description><![CDATA[Stephen or Arnoud,

How would i deal with variables within Functions that I would like to Split-Job?  

Here is a snip of my script:

Import-Module -Name ._ModulesSplit-Job.psm1

Function GetSystemState
{ # Begin Function GetSystemState()
	# Pings each of the system names found to check if online
    # Writes findings to a files.
		$intCounter++
		Write-Host &quot;[&quot;$intCounter&quot;/&quot;$intCounterMax]&quot; Checking Computer: &quot; $_  -BackgroundColor Cyan -ForegroundColor White
        If (Test-Connection -ComputerName $_ -Quiet -Count 1)
        { # If Computer is alive
            # Adds Computer Name to Alive File
            $strAliveList += $_
        } # End of True Test-Connection
        Else # Test-Connection
        { # Begin of Else for Test-Connection
            $strDeadList += $_
        } # End of Else for Test-Connection
} # End Function GetSystemState()

# Function Variables
$GLOBAL:strAliveList = @()
$GLOBAL:strDeadList = @()

# Get Computer Status
# Determines if Computer is On-Line
Write-Host &quot;Getting Computer Status....................................................&quot; -BackgroundColor Black -ForegroundColor White
$GLOBAL:intCounter = 0
$GLOBAL:intCounterMax = $computerList.Length
$computerList &#124; Split-Job { % {GetSystemState}} -Function GetSystemState


It does not update my Alive or Dead Variables nor does it increment my counter.  I also have split-job running another part of my script where it searches the alive computers and put information inside variables as well with the same result of not passing back to main script.

Any and all help would be greatly appreciated!!!  I fairly new to powerschell and all self-taugh with google search help.  That&#039;s were I came accross your script.  I am running v1.2]]></description>
		<content:encoded><![CDATA[<p>Stephen or Arnoud,</p>
<p>How would i deal with variables within Functions that I would like to Split-Job?  </p>
<p>Here is a snip of my script:</p>
<p>Import-Module -Name ._ModulesSplit-Job.psm1</p>
<p>Function GetSystemState<br />
{ # Begin Function GetSystemState()<br />
	# Pings each of the system names found to check if online<br />
    # Writes findings to a files.<br />
		$intCounter++<br />
		Write-Host &#8220;["$intCounter"/"$intCounterMax]&#8221; Checking Computer: &#8221; $_  -BackgroundColor Cyan -ForegroundColor White<br />
        If (Test-Connection -ComputerName $_ -Quiet -Count 1)<br />
        { # If Computer is alive<br />
            # Adds Computer Name to Alive File<br />
            $strAliveList += $_<br />
        } # End of True Test-Connection<br />
        Else # Test-Connection<br />
        { # Begin of Else for Test-Connection<br />
            $strDeadList += $_<br />
        } # End of Else for Test-Connection<br />
} # End Function GetSystemState()</p>
<p># Function Variables<br />
$GLOBAL:strAliveList = @()<br />
$GLOBAL:strDeadList = @()</p>
<p># Get Computer Status<br />
# Determines if Computer is On-Line<br />
Write-Host &#8220;Getting Computer Status&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.&#8221; -BackgroundColor Black -ForegroundColor White<br />
$GLOBAL:intCounter = 0<br />
$GLOBAL:intCounterMax = $computerList.Length<br />
$computerList | Split-Job { % {GetSystemState}} -Function GetSystemState</p>
<p>It does not update my Alive or Dead Variables nor does it increment my counter.  I also have split-job running another part of my script where it searches the alive computers and put information inside variables as well with the same result of not passing back to main script.</p>
<p>Any and all help would be greatly appreciated!!!  I fairly new to powerschell and all self-taugh with google search help.  That&#8217;s were I came accross your script.  I am running v1.2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Mills</title>
		<link>http://jansveld.net/powershell/?p=11#comment-571</link>
		<dc:creator>Stephen Mills</dc:creator>
		<pubDate>Fri, 27 May 2011 21:18:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-571</guid>
		<description><![CDATA[@Charles

Here&#039;s a quick way to get what you seem to be looking for.

&#039;computer1&#039;, &#039;computer2&#039;, &#039;computer3&#039; &#124; Split-Job { % { GWMI Win32_OperatingSystem -ComputerName $_ -Property CSName, LocalDateTime, LastBootUpTime }} &#124; Select @{n=&#039;ComputerName&#039;;e={ $_.CSName}}, @{n=&#039;UpTime&#039;;e={ [datetime]$_.LocalDateTime - [datetime]$_.LastBootUpTime}}]]></description>
		<content:encoded><![CDATA[<p>@Charles</p>
<p>Here&#8217;s a quick way to get what you seem to be looking for.</p>
<p>&#8216;computer1&#8242;, &#8216;computer2&#8242;, &#8216;computer3&#8242; | Split-Job { % { GWMI Win32_OperatingSystem -ComputerName $_ -Property CSName, LocalDateTime, LastBootUpTime }} | Select @{n=&#8217;ComputerName&#8217;;e={ $_.CSName}}, @{n=&#8217;UpTime&#8217;;e={ [datetime]$_.LocalDateTime &#8211; [datetime]$_.LastBootUpTime}}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Mills</title>
		<link>http://jansveld.net/powershell/?p=11#comment-570</link>
		<dc:creator>Stephen Mills</dc:creator>
		<pubDate>Thu, 21 Apr 2011 21:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-570</guid>
		<description><![CDATA[Thanks for uploading it.  I&#039;ve uploaded a version 1.2 that actually only works with PowerShell V2, but also works with powershell_ise.  The 1.0 version would leave the pipelines running if you exited the script early ( by hitting Escape in powershell_ise or Ctrl-C in powershell.exe) .  It also adds various other improvements like InitializeScript, MaxDuration, time remaining, and a few other minor things.

http://poshcode.org/2621]]></description>
		<content:encoded><![CDATA[<p>Thanks for uploading it.  I&#8217;ve uploaded a version 1.2 that actually only works with PowerShell V2, but also works with powershell_ise.  The 1.0 version would leave the pipelines running if you exited the script early ( by hitting Escape in powershell_ise or Ctrl-C in powershell.exe) .  It also adds various other improvements like InitializeScript, MaxDuration, time remaining, and a few other minor things.</p>
<p><a href="http://poshcode.org/2621" rel="nofollow">http://poshcode.org/2621</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnoud Jansveld</title>
		<link>http://jansveld.net/powershell/?p=11#comment-569</link>
		<dc:creator>Arnoud Jansveld</dc:creator>
		<pubDate>Wed, 20 Apr 2011 17:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-569</guid>
		<description><![CDATA[Great idea! I had a few minor updates in the pipeline as well and posted it here: http://poshcode.org/2619.]]></description>
		<content:encoded><![CDATA[<p>Great idea! I had a few minor updates in the pipeline as well and posted it here: <a href="http://poshcode.org/2619" rel="nofollow">http://poshcode.org/2619</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Mills</title>
		<link>http://jansveld.net/powershell/?p=11#comment-568</link>
		<dc:creator>Stephen Mills</dc:creator>
		<pubDate>Wed, 20 Apr 2011 04:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-568</guid>
		<description><![CDATA[Would you mind if I would post this ( well an updated version of it) to poshcode.org?  I was just at TEC 2011 and the PowerShell Deep Dive some of the people are interested in it.  I could always send them a copy, but it would be nice to have it somewhere, where everyone could get it easily and potentially post updates to it.

Thanks,

Stephen]]></description>
		<content:encoded><![CDATA[<p>Would you mind if I would post this ( well an updated version of it) to poshcode.org?  I was just at TEC 2011 and the PowerShell Deep Dive some of the people are interested in it.  I could always send them a copy, but it would be nice to have it somewhere, where everyone could get it easily and potentially post updates to it.</p>
<p>Thanks,</p>
<p>Stephen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Welton</title>
		<link>http://jansveld.net/powershell/?p=11#comment-567</link>
		<dc:creator>Charles Welton</dc:creator>
		<pubDate>Sat, 29 Jan 2011 23:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.jansveld.net/powershell/?p=8#comment-567</guid>
		<description><![CDATA[Hello...

I just found your site by chance looking for help trying to multi-thread a powershell script.  I am still rather unfamiliary with powershell syntax and need a quick fix.  Here is my code below:

##
#  Start of script
##

# Helper Function - convert WMI date to TimeDate object
function WMIDateStringToDate($Bootup) {
	[System.Management.ManagementDateTimeconverter]::ToDateTime($Bootup)
}

# Main script
$Computer = $args[0] # adjust as needed
$computers = Get-WMIObject -class Win32_OperatingSystem -Impersonation 3 -computer $computer -authentication 6
#$computers = Get-WMIObject -class Win32_OperatingSystem -computer $computer

foreach ($system in $computers) {
	$Bootup = $system.LastBootUpTime
	$LastBootUpTime = WMIDateStringToDate($Bootup)
	$now = Get-Date
	$Uptime = $now - $lastBootUpTime
	$d = $Uptime.Days
	$h = $Uptime.Hours
	$m = $uptime.Minutes
	$ms= $uptime.Milliseconds

	&quot;System Up for: {0} days, {1} hours, {2}.{3} minutes&quot; -f $d,$h,$m,$ms
} 
# End script

Any ideas how I could use &quot;start-job&quot; for mutli-threading?  Let&#039;s say I have 20 servers I need to run this script against, and I want them all running in parallel.

ANY help would be greatly appreciated!!!! :)]]></description>
		<content:encoded><![CDATA[<p>Hello&#8230;</p>
<p>I just found your site by chance looking for help trying to multi-thread a powershell script.  I am still rather unfamiliary with powershell syntax and need a quick fix.  Here is my code below:</p>
<p>##<br />
#  Start of script<br />
##</p>
<p># Helper Function &#8211; convert WMI date to TimeDate object<br />
function WMIDateStringToDate($Bootup) {<br />
	[System.Management.ManagementDateTimeconverter]::ToDateTime($Bootup)<br />
}</p>
<p># Main script<br />
$Computer = $args[0] # adjust as needed<br />
$computers = Get-WMIObject -class Win32_OperatingSystem -Impersonation 3 -computer $computer -authentication 6<br />
#$computers = Get-WMIObject -class Win32_OperatingSystem -computer $computer</p>
<p>foreach ($system in $computers) {<br />
	$Bootup = $system.LastBootUpTime<br />
	$LastBootUpTime = WMIDateStringToDate($Bootup)<br />
	$now = Get-Date<br />
	$Uptime = $now &#8211; $lastBootUpTime<br />
	$d = $Uptime.Days<br />
	$h = $Uptime.Hours<br />
	$m = $uptime.Minutes<br />
	$ms= $uptime.Milliseconds</p>
<p>	&#8220;System Up for: {0} days, {1} hours, {2}.{3} minutes&#8221; -f $d,$h,$m,$ms<br />
}<br />
# End script</p>
<p>Any ideas how I could use &#8220;start-job&#8221; for mutli-threading?  Let&#8217;s say I have 20 servers I need to run this script against, and I want them all running in parallel.</p>
<p>ANY help would be greatly appreciated!!!! <img src='http://jansveld.net/powershell/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
