

Get your most common PowerShell commands by inspecting your PSReadLine history
source link: https://gist.github.com/devblackops/9cbfb88d426426e6a45cab724a9a2a27
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Get your most common PowerShell commands by inspecting your PSReadLine history · GitHub
Instantly share code, notes, and snippets.
PSParser is ancient and doesn't handle things well; use System.Management.Automation.Parser.ParseInput()
instead:
$Errors = $null
$Tokens = $null
$Ast = [System.Management.Automation.Language.Parser]::ParseInput(
( Get-Content (Get-PSReadLineOption).HistorySavePath ),
[ref]$Tokens,
[ref]$Errors
)
$Tokens |
Where-Object { $_.TokenFlags.HasFlag([System.Management.Automation.Language.TokenFlags]::CommandName) } |
Select-Object Text | Group-Object Text |
Sort-Object Count, Name -Descending | Select-Object Count, Name -First 20
Recommend
-
5
Announcing PSReadLine 2.1+ with Predictive IntelliSenseJasonNovember 10th, 2020Tab completion has accelerated the success of new and experienced PowerShell users for ove...
-
8
Updating help for the PSReadLine moduleUpdating help for the PSReadLine module
-
10
master PSReadLine/PSReadLine/
-
13
You should be customizing your PowerShell Prompt with PSReadLine Sponsored By I use PowerShell 7 (cross platform, open source...
-
14
Updating help for the PSReadLine module in Windows PowerShell 5.1Updating help for the PSReadLine module in Windows PowerShell 5.1
-
11
Adding Predictive IntelliSense to my Windows Terminal PowerShell Prompt with PSReadline Sponsored By I've long said
-
4
PSReadLine 2.2 RC Jason January 31st, 2022 We are pleased to announce the Release Candidate (R...
-
6
我的 如何打造一個華麗又實用的 PowerShell 命令輸入環境 文章 (影片在此) 幫助...
-
4
好看是第一生产力。 — 鲁迅 最终效果如封面。 Windows Terminal基础配置Scoop安装Scoop是一款Windows下的包管理器,不是必须安装的,但是之后的部分配置我是用Sco...
-
9
PSReadLine 2.2.6 enables Predictive Intellisense by default
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK