From 56a58c700aac8f9bccd4d41126a68853443e4ddf Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 28 Nov 2020 19:56:55 +0100 Subject: [PATCH] fix: auto complete themes in Powershell --- packages/powershell/oh-my-posh/oh-my-posh.psm1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 46767d98..e345ec1e 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -152,7 +152,10 @@ function ThemeCompletion { $commandAst, $fakeBoundParameter ) - $themes = Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.omp.json' | Sort-Object Name | Select-Object -Property BaseName + $themes = Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.omp.json' | Sort-Object Name | Select-Object -Property @{ + label='BaseName' + expression={$_.BaseName.TrimEnd(".omp")} + } $themes | Where-Object { $_.BaseName.ToLower().StartsWith($wordToComplete.ToLower()); } | Select-Object -Unique -ExpandProperty BaseName |