ps/Modules/Cole.PowerShell.Developer/Scratch/parallel tests/nested test.ps1

29 lines
775 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
$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&paras=30'
Invoke-JobRunner -JobInputs $meats -ScriptBlock $sbOuter