Just trying to grasp this concept, now I know what it’s called
may be caveats / methods involved like
select -expand
(wrap it all up)
explicit out-host
or even pipe to | Tee-Object
Great online example helped me get to where I’m at, re example:
getting TlDr* of scheduled tasks
Challenge is ‘merging’ the output from TaskInfo
Get-ScheduledTask -TaskPath *MyTaskPath* | Get-ScheduledTaskInfo |
select TaskName, TaskPath, LastRunTime, LastRunResult | fl
with info from Task to get user
Get-ScheduledTask -TaskPath *MyTaskPath* | select -ExpandProperty Principal | select -ExpandProperty UserId
with the example #10 I’ve got it kinda working, but the first output arrives a few empty lines above the others… anyway known pipeline foreach / other syntactical sugar available to get
a formatted list of selected properties from multiple objects in pipeline inputs?
eg how to improve this
Get-ScheduledTask -TaskPath *MyTaskPath* |
% -Begin $null -Process {$_.Principal | select -ExpandProperty UserId} ,
{Get-ScheduledTaskInfo $_ | select TaskName, TaskPath, LastRunTime, LastRunResult} -End $null | fl
Thanks in advance almight PS .{com | org :}