How do you design useful logging for an administrative PowerShell script?
Documentation: Microsoft Learn
Log decisions, targets, start/end times, correlation identifiers, errors and verification results.
Interview · Question 12 of 34
Answer before reveal
Your draft
Write the answer you would give in an interview. The model answer stays hidden until you have drafted at least a short response.
A strong answer
Log decisions, targets, start/end times, correlation identifiers, errors and verification results. Keep structured operational records separate from secrets and use verbose/debug streams for detail that should not contaminate normal output.
Show it concretely
Expect this follow-up
When would you use Start-Transcript, and what does it fail to capture cleanly?