New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automation: Merge jobs #1374
Comments
You could effectively do this by using -Wait. It would bring the errors, warnings and output from the other script into the calling script. |
Appreciate looking into this request. Below are my current finding with sample script to simulate the issue Based on my observation, messages are still written to the child job, in addition to that a error message 'Object reference not set to an instance of an object' is written to output when -Wait parameter is used but the system does wait until the child process is complete. I was hoping if there is a way to run just one job. At the least if the log-messages were written to parent job that would be great. No idea why we receive a object reference issue, am I missing something ? Version : 3.1.0 Parent script
Child Script
Parent Job output Child job output |
This shouldn't be happening. Let me try to reproduce this. |
Can you try to use integrated mode? I just put together an integration test for this that works so this may be a workaround.
|
@arunrajann - Can you let me know what version you are using? |
Version : 3.1.0 (2653491244) Downloaded from the main download page on 7/12/2022. |
Below is reference from another Team member in the community who received an error when -Wait parameter is used. I could use ' | Wait-PSUJob ' to make the parent process to wait until the child process is complete... However, using it does not write the message / merge the child job with Parent which is what I was hoping to accomplish. https://forums.ironmansoftware.com/t/invoke-psuscript-object-error/7296 |
I have reproduced this and it will be fixed in 3.1.4 |
This issue has been mentioned on Ironman Software Forums. There might be relevant details there: https://forums.ironmansoftware.com/t/regarding-invoke-psuscript/7419/1 |
Summary of the new feature / enhancement
When a script is called / triggered from another script using 'Invoke-PSUScript', the PSU is creating a new / separate job for the child. I am sure there is a good reason why this design pattern is implemented. It becomes a little harder to analyze the log information created by the individual script as we have to jump back and forth between multiple jobs. It would `be great if we have an option to treat them as one integral job and log all the information in one job.
Invoke-PSUScript -Name DataExtract.ps1 -SourceSystemHostName $_SourceSystemHostName -SourceDatabaseName $_SourceDatabaseName
Proposed technical implementation details (optional)
Add a Parameter to 'Invoke-PSUScript' Cmdlet to treat them as one job / not to create a new job.
The text was updated successfully, but these errors were encountered: