29 lines
775 B
PowerShell
29 lines
775 B
PowerShell
$sbOuter = {
|
|
param (
|
|
$paragraph
|
|
)
|
|
|
|
. Z:\git\cole_module\Modules\Cole.PowerShell.Developer\Public\Invoke-JobRunner.ps1
|
|
|
|
$sentences = $paragraph -split ' '
|
|
|
|
$sbInner = {
|
|
param (
|
|
$bunchOfStuff,
|
|
$ParentPid
|
|
)
|
|
|
|
foreach($stuff in $bunchOfStuff) {
|
|
Write-Host "$ParentPid : $PID : I found a thing called '$stuff' in my stuff"
|
|
}
|
|
}
|
|
|
|
Write-Host "$PID : About to runner some inner stuff"
|
|
Invoke-JobRunner -JobInputs $sentences -ScriptBlock $sbInner -AdditionalArguments $PID
|
|
Write-Host "$PID : Finished running my inner stuff"
|
|
}
|
|
|
|
$meats = Invoke-RestMethod 'https://baconipsum.com/api/?type=meat-and-filler¶s=30'
|
|
|
|
Invoke-JobRunner -JobInputs $meats -ScriptBlock $sbOuter
|