Logging when a script quits

Welcome Forums General PowerShell Q&A Logging when a script quits

This topic contains 1 reply, has 2 voices, and was last updated by

1 year, 7 months ago.

  • Author
  • #74901

    Points: 0
    Rank: Member

    Hi Everyone

    Wondering if there is a way to log if a user quits a powershell script while it is running?

    So if the user just Xs out of the script it would log the move before it officially quits. I would also like to log if the computer goes to reboot while the script is running and the computer quits the script.

    Is this possible?

  • #74902

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    Not really. They're killing the process; the process' contents – your script – aren't notified of that. You'd probably have to develop a custom host.

The topic ‘Logging when a script quits’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort