I have loved PSU. I have bragged about it, it’s usefulness, recommended it to others etc. We are in fact in the process of possibly using it for more purposes in our organisation by other groups.
But right now I am a bit irritated since I have dealt with our technological debt and quickly moved from v2 via v3 to v4, looking ahead into v5.
I may also be an idiot and have missed something completely. In that case, please tell.
I have gripes about how resent versions of PSU are handling jobs. Incrementally changed behavior of child jobs are breaking my solution, leaving me, as far as I can see, without good options without significant architectural changes. I, frankly, want the old behavior back. At least be able to opt-out somehow.
One way to achieve this could be to add a Invoke-PSUScript -Detached flag or something along those lines to start jobs from other jobs without setting a parent job for it. I.e., behave as if it was called by a dashboard.
TL;DR:
So what’s going on? In PSU v2 and v3 jobs were jobs, plain and simple. If I started a job from a dasboard, I got a job. If I started it from another job, I got a job. They behaved the same. All jobs were presented as a flat list, both in the global and the per-script views. A parent job id may have been set, but no fuss was made about it.
Enter PSU v4. Superficially, it is the same. The presentation is the same as in v3. Jobs are jobs. But, suddenly the job output is deleted, or “groomed”, by a completely different schedule. This is a major, breaking change that is, as far as I can tell, unmentioned in any docs (I’m happy to be proven wrong). Because in v4, the data of the script, log, pipeline etc, are no longer groomed according to the settings of the script itself, but according to the settings of the parent script invoking it.
So suddenly running Invoke-PSUScript by a dashboard, hence no parent job, and running Invoke-PSUScript by another script, that does not happen to be a dashboard, behave different in, for my solution, really, really significant ways.
Now, with PSU v5, the situation has become worse. Now jobs started by other jobs are also presented completely different. They are completely hidden from the Job view of the script itself. They are hidden beneath the invoking job in the global view, making the output very hard to find. Jobs invoked by the dashboard are proper jobs. Jobs invoked by other jobs are just some sub-component of the invoking job. Invoke-PSUScript produces two, completely different results depending on context.
So why is this an issue for my solution? I have a possibly long-running script which is involved in moving IT-forensic information nationally between storage solutions and domains, across long distances, possibly transforming information, possibly injecting information in systems for analytics etc. It is a bit of a beast. The output of this script is kept for some time for follow ups, statistics etc. 60 days 1000 invokations was the limit we maxed out in v2.
It can be invoked manually from data collected by PSU and presented in a dashboard. It can also be invoked automatically by PSU, e.g, by way of “orders” placed on disk by other automations and collected by PSU. The automatic invokations are made by a frequently running script which is simply responsible for checking some prerequisites and then invoking the major script. The output of this parent script is completely uninteresting, but PSU has decided that it is the most important thing ever and that the output I really want is just garbage. I have thoughts.
Please, give me an option to start jobs without hiding it under a parent job and deleting my data with some other policy than that of the script itself.
Regards,
Fredrik Jönsson
Product: PowerShell Universal
Version: 4.4.1, 5.0.10