Open
Description
The [Microsoft.PowerShell.PSConsoleReadLine]::AddToHistory method makes it really easy to add a command to the history. Is there a corresponding method to remove a command from the history?
I would like to write a function to bind to a key that would recall the last command from the history so I can correct it. Sort of like an UndoLastCommand function. I would use this after entering a command with a misspelling or other syntax problem. Such a command has no useful purpose in the history (I would never want to execute it again).
Hopefully this description makes sense. Is such a thing possible today? Or would this require some coding within the PSReadLine module before I could write a PowerShell script to do this?