unfortunately, most shells add commands to the history _before_ they're executed, and PowerShell uses your raw history for "Predictions"
You can prevent most typos from being executed by pre-validating using:
Set-PSReadLineKeyHandler -key Enter -Function ValidateAndAcceptLine
You can also disable history predictions:
Set-PSReadLineOption -PredictionSource Plugin
Or customize the history handler:
Set-PSReadLineOption -AddToHistoryHandler { ... }