Skip to content

Move regex-based History exclusion to AST-based to play nice with SecretMangement #1840

@TylerLeonhardt

Description

@TylerLeonhardt

Description of the new feature/enhancement

Because every command in SecretManagement has Secret in the name, every command invocation gets excluded from history. This isn't a good experience especially since SecretManagement is helping with the "secrets not in plaintext" situation.

Here are some examples that would be nice to have in history:

Get-Secret PSGalleryApiKey -AsPlainText
Publish-Module -Name Foo -NuGetApiKey (Get-Secret PSGalleryApiKey -AsPlainText)

However, we need to make sure that something like this still gets excluded:

Get-ResultFromTwoSecrets -Secret1 (Get-Secret -Name blah -AsPlainText) -Secret2 sdv87ysdfayf798hfasd8f7ha

Proposed technical implementation details (optional)

This regex based filter:

"password|asplaintext|token|apikey|secret",

should be AST based and play nice with an exclusion list.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions