Improve performance of Package identification
Using -ListAvailable with Get-Command to ensure no module loading is attampeted while querying loaded commands. This improved performance when certain modules have not been loaded yet
This commit is contained in:
parent
499a86baa6
commit
22aa3ba435
10 changed files with 17 additions and 17 deletions
|
@ -17,7 +17,7 @@ end {
|
|||
$local:editors = $env:EDITOR,'nvim','code'
|
||||
$local:editor = $null
|
||||
foreach( $local:testEditor in $editors ) {
|
||||
if( $(try{Get-Command -Type Application $testEditor -ErrorAction SilentlyContinue}catch{}) ) {
|
||||
if( $(try{Get-Command -ListImported -Type Application $testEditor -ErrorAction SilentlyContinue}catch{}) ) {
|
||||
$editor = $testEditor
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue