r/PowerShell • u/AFollowerOfTheWay • Dec 09 '25
Does a Powershell Autocomplete Exist?
Pretty much the title.
I’m looking for some type of plugin, mod, or Powershell alternative that will autocomplete and/or fix typos in my commands.
For instance if I were to type “winfet” it would correct or suggest it “winget”. Or if I often type “ssh username@___” it suggests everything after ssh. Powershell already saves the IP, which is nice, but it’d be cool to find something that does a bit more.
Essentially I’m looking for the notepad++ equivalent of Powershell. Does this exist?
0
Upvotes
8
u/ninhaomah Dec 09 '25
Have you googled ?
This is the first result I get
https://techcommunity.microsoft.com/blog/itopstalkblog/autocomplete-in-powershell/2604524
2
u/syntax_error16 Dec 09 '25
Check out the PSReadLine module.... It's amazing.
43
u/Murhawk013 Dec 09 '25
Powershell has Intellisense, but just install VS Code and Powershell plug-in and use that
9
u/Ok_Mathematician6075 Dec 09 '25
Character /tab
7
u/CitizenOfTheVerse Dec 09 '25
Use VSCode with powershell extensions. No professional scripter want something that changes what he writes. Auto-Complete or suggestion is ok, flagging typo in IDE is ok, code review is also ok if you review what the reviewer reviewed, but auto-fixing what you wrote like when you type a message for a friend but here in the case of meaningful code that will be executed? No never. Don't do that. Take care of what you write and review what you wrote.
4
u/odwulf Dec 09 '25
You won't find a full solution that corrects your errors. As others have said, it's not a good idea to autocorrect commands, it can misfire easily. And "everything" is a bit wide. The powertoy u/savehonor points to is a good start. I use the cbsch-ssh module to handle ssh commands and autocomplete too.
7
u/My_Big_Black_Hawk Dec 09 '25
Wait until this guy gets a load of vscode with copilot agent mode.
3
u/fdeyso Dec 09 '25
You mean an IDE?
3
u/narcissisadmin Dec 09 '25
Yuck, never ever trust ducking autocorrect...especially when you're running commands.
I have this in my $profile because I cannot stand the Windows style of tab completion (cycling through matches). Bash-style is the only way to go.
3
u/surfingoldelephant Dec 09 '25 edited Jun 10 '26
Are you working interactively in the shell or with a code editor?
If it's for the shell and you're using PS v7.5+,
PSCommandNotFoundSuggestioncan help if you first ensurePSFeedbackProvideris enabled.Note that the file extension needs to be included to trigger native/external command suggestions, but hopefully that'll be fixed (see issue #26591).
If you're using Linux, also have a look at the
command-not-foundmodule, which works withPSReadLine's Predictive IntelliSense.If you're not using PS v7+, you'll need to implement that yourself. There's a few options to intercept the typoed command:
$ExecutionContext.InvokeCommand.CommandNotFoundActioncallback.PSReadLinekey handler that binds to<Enter>.CommandNotFoundException.Then you'll need to fuzzy match on the typo against a list of valid commands.
Jaykul has a great write-up on the first option and also shows one way of fuzzy matching using the Levenshtein edit distance (similar to how
Get-Command -UseFuzzyMatchingis implemented in PS v7+). And you'll probably want an interactive prompt to confirm if the found command was intended, rather than just blindly running whatever was found.That's a feature of
PSReadLine's Predictive IntelliSense. You'll need to check you if you have the latest version (or v2.2.2+ at the very least, but note that history prediction was only enabled by default in v2.2.6).Windows PowerShell (v5.1) supports the
Historyprediction source, but again, make sure you updatePSReadLineas the shipped version is outdated. See here for instructions.You can press
F2to switch between Predictive IntelliSense'sInlineView(default) andListViewmode or you can make an absolute change (see this comment for more information):In PS v7.2+, if you install
CompletionPredictorand setPSReadLine's prediction source toHistoryAndPlugin, you'll get predictions similar to what tab completion offers.With
ListView, you can interactively select the prediction using the arrow keys and<Enter>.CompletionPredictoris pretty basic (it's more of a demo). You'll need to search around for other prediction plugins or look into writing your own if you want anything more advanced. I had a quick look and found the following, thought I suggest doing your own searching/vetting:PowerTypePoshPredictiveTextSnippetPredictor2
u/savehonor Dec 09 '25
Not a complete solution, but perhaps one part of many:
https://learn.microsoft.com/en-us/windows/powertoys/cmd-not-found
2
u/redditformat Dec 09 '25
VS Code
1
u/MalletNGrease Dec 10 '25
I just use my pinky
1
u/DarkSpoon Dec 10 '25
Neovim with Mason works well for me
1
u/Madeupsky May 05 '26
If anyone is still looking, i made something simple and it is working, and does exactly what OP has said, plus intellisense (in the works, but auto complete and autocorrect are there) - here is the github link but idk if i can post it. not advertisting, its open source and I make nothing from this. github/Sxriptor/Intellisense-Terminal (npm install -g terminalsense)
-2
u/PutridLadder9192 Dec 09 '25
Copilot does this but people are emotionally devastated by AI code assistance so they will say it cant