From bc757d8bcdb8e3e7b65cc59fcb3e1f0ffe3729d2 Mon Sep 17 00:00:00 2001 From: Jeff Hicks Date: Fri, 28 Sep 2018 16:31:53 -0400 Subject: [PATCH] updated month autocompleter to be better culture aware --- PSCalendar.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PSCalendar.psm1 b/PSCalendar.psm1 index aadf6b6..910bf09 100644 --- a/PSCalendar.psm1 +++ b/PSCalendar.psm1 @@ -10,7 +10,9 @@ Register-ArgumentCompleter -CommandName Get-Calendar, Show-Calendar -ParameterNa param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) #get month names, filtering out blanks - (Get-Culture).DateTimeFormat.MonthNames | Where-object {$_ -match "\w+" -and $_ -match "$WordToComplete"} | + #(Get-Culture).DateTimeFormat.MonthNames + $Culture = ([system.threading.thread]::currentThread).CurrentCulture + [cultureinfo]::GetCultureInfo($culture).DateTimeFormat.Monthnames | Where-object {$_ -match "\w+" -and $_ -match "$WordToComplete"} | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_.Trim(), $_.Trim(), 'ParameterValue', $_) }