Skip to content

Add callback feature to Start-Transcript #17588

Closed

Description

@iRon7

Summary of the new feature / enhancement

Judging from the StackOverflow questions, it appears to me that custom log files implementations are more often used then the native Start-Transcript cmdlet and suspect that this is due to the fact enterprise companies (as the one I am working for) want their own logging facilities which might be a specific log format (e.g. including a specific time stamp per entry) up till writing (specific) entries to a database.

Proposed technical implementation details (optional)

A -Script <ScriptBlock> parameter that refers to a script that is called at each logging event. Within the script (which might need to run in a different scope), I would expect to have access to information (via current item ($_)?) as:

  • A reference to thr output streams since last event
  • The timestamp of the event (basically the current time)
  • Transcript properties/parameters (as the Path if supplied)
  • ...

Activity

  1. added
    Issue-Enhancementthe issue is more of a feature request than a bug
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Jun 27, 2022
  2. PaulHigin commented on Jun 27, 2022

    @PaulHigin
    Contributor

    This feels like a reasonable request for some kind of logging provider mechanism for transcripts. But we need to think carefully about how this could be abused for information disclosure.

  3. PaulHigin commented on Jul 18, 2022

    @PaulHigin
    Contributor

    @WG-Security
    Working security group discussed this and have concerns about inadvertently exposing sensitive information to arbitrary providers, that may move the data off-box. PowerShell transcripts captures all data written to the console, which can include secrets, and therefore it is more sensitive to where that data goes. If we implemented a transcript collection provider architecture, we would have to also include some sort of encryption scheme.

  4. SeeminglyScience commented on Sep 19, 2023

    @SeeminglyScience
    Contributor

    @PowerShell/wg-powershell-engine reviewed this. We think transcripts are best suited to auditing rather than log writing (even with the proposal to bring it closer to logging).

    That said, a custom Out-Default or even PSHost implementation could accomplish similar results as the proposal (though slightly more involved).

  5. microsoft-github-policy-service commented on Sep 21, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as declined and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-DeclinedThe proposed feature is declined.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions