I’m trying to write a script that will update a log file with each step of an OSD task sequence in SCCM. Is there a way to capture the output as it happens to a log file ?
You can use Get-Content with the -Wait switch (in a separate window, of course), though I’ve occasionally run into situations where that didn’t show the output until the other process closed the file, for some reason. If you find you’re in that situation, you can also look for “tail.exe”; there are many windows ports of that command, which does the same thing using native API calls that seem to be more reliable.