Hello everyone. I use Start-Transcript before starting my script, there is a block in the script in which the processes will terminate, I specified -verbose there and in the ISE console I see events about the termination of processes. But if you look at my log, there are no -verbose entries, I don’t see how I can get them to write to the log.
In PowerShell we pass objects down the pipeline. You’re trying to pass the objects and the verbose information down the pipeline. I wouldn’t expect this to work for cmdlets you actually want them to do something meaningful with your objects.
You may choose what’s important - the logging or the actual task you want to accomplish.
I’d separate the “workload” from the “logging”. A simple version would be something like this: