File tree 2 files changed +21
-1
lines changed
Tests/Engine/SettingsTest/Issue1095
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ private void parseSettingsHashtable(Hashtable settingsHashtable)
395
395
var settings = GetDictionaryFromHashtable ( settingsHashtable ) ;
396
396
foreach ( var settingKey in settings . Keys )
397
397
{
398
- var key = settingKey . ToLower ( ) ;
398
+ var key = settingKey . ToLowerInvariant ( ) ;
399
399
object val = settings [ key ] ;
400
400
switch ( key )
401
401
{
Original file line number Diff line number Diff line change
1
+ Describe " Issue 1095: An exception is thrown when CurrentCulture is Turkish (tr-TR)" {
2
+ It " Should not throw an exception when CurrentCulture is tr-TR" {
3
+ # https://github.com/PowerShell/PSScriptAnalyzer/issues/1095
4
+
5
+ $initialCulture = Get-Culture
6
+ $initialUICulture = Get-UICulture
7
+
8
+ {
9
+ $trTRculture = [System.Globalization.CultureInfo ]::GetCultureInfo(' tr-TR' )
10
+ [System.Threading.Thread ]::CurrentThread.CurrentUICulture = $trTRculture
11
+ [System.Threading.Thread ]::CurrentThread.CurrentCulture = $trTRculture
12
+ Invoke-Formatter " `$ test" - ErrorAction Stop
13
+
14
+ } | Should - Throw -Not
15
+
16
+ [System.Threading.Thread ]::CurrentThread.CurrentCulture = $initialCulture
17
+ [System.Threading.Thread ]::CurrentThread.CurrentUICulture = $initialUICulture
18
+
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments