dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.62k stars 802 forks source link

Time-consuming command pattern in Get-AliasPattern function #971

Open peetrike opened 1 month ago

peetrike commented 1 month ago

System Details

Issue Description

I am experiencing a problem with Get-AliasPattern function, that is running part of it in about 500 times when profile script is running. The problematic code is the pattern get-alias | where . This could be replaced with get-alias -Definition "$cmd", "$cmd.exe" and it becomes ~5..8 times faster.

The similar pattern is in GitTabExpansion.ps1.