Product: PowerShell Universal
Version: 3.1.4
Ref: https://github.com/ironmansoftware/issues/issues/1374
@adam Thanks for applying the fixes to Invoke-PSUScript in 3.1.4.
With the latest version I don’t see the Object reference error now.
However, when ‘-Wait -Integrated’ parameters are used I unable to forward the messages in Child script to the Parent script logging yet. Is this something you would expect with the revised fix. Screenshot below for reference.
My objective is to have all the logs written to Parent job regardless of the task is performed by Parent / Child job as it would help us to have the capability to audit / review the log in a single place instead of jumping back and forth between different jobs. I hope its possible with ‘-Wait -Integrated’ parameter, but no luck yet.
Script to re-produce the issue
Parent script :
It all starts with a single line of powershell code.
Write-Host ‘Begin Parent job…’
Invoke-PSUScript -Name TestScript.ps1 -Wait -Integrated
Write-Host ‘Completed Parent job…’
Child script : TestScript.ps1
It all starts with a single line of powershell code.
param
(
)
write-host “Begin executing Child script…”
Start-Sleep -Seconds 10
write-host “Completed Child script…”
Current output