Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Warn users that "Add-JournalEntryContent" could store sensitive content in PSReadLine history #63

Description

@refactorsaurusrex

Summary

By default, when Add-JournalEntryContent is used, the command text is persisted to PSReadLine history. Given that this text could easily contain sensitive information, users should be warned about this risk and advised how to configure PSReadLine to avoid storing this command in history.

Tasks

  • When Add-JournalEntryContent is run, warn users that this command is persisted to history.
  • Allow users to disable this warning going forward.
  • Provide a link to the documentation website where it describes how to configure PSReadLine to skip logging this command.
  • Add this information to the documentation website.

Solution

This should be added to the user's PS profile

Set-PSReadLineOption -AddToHistoryHandler {
  param($line) 
  "Add-JournalEntryContent*","aje*" | ForEach-Object { 
    if ($line -like $_) {
      return $false
    }
  }
}

https://docs.microsoft.com/en-us/powershell/module/psreadline/about/about_psreadline?view=powershell-7

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions