File tree 2 files changed +27
-1
lines changed
Tests/Engine/SettingsTest/Issue1095
2 files changed +27
-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 . ToLower ( CultureInfo . GetCultureInfo ( "en-US" ) ) ;
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
+
6
+ {
7
+ $trTRculture = [System.Globalization.CultureInfo ]::GetCultureInfo(' tr-TR' )
8
+ Set-Culture $trTRculture
9
+ [System.Threading.Thread ]::CurrentThread.CurrentUICulture = $trTRculture
10
+ [System.Threading.Thread ]::CurrentThread.CurrentCulture = $trTRculture
11
+ Invoke-Formatter " `$ test" - ErrorAction Stop
12
+
13
+ } | Should - Throw -Not
14
+
15
+ BeforeEach {
16
+ $initialCulture = Get-Culture
17
+ $initialUICulture = Get-UICulture
18
+ }
19
+
20
+ AfterEach {
21
+ Set-Culture $initialCulture
22
+ [System.Threading.Thread ]::CurrentThread.CurrentCulture = $initialCulture
23
+ [System.Threading.Thread ]::CurrentThread.CurrentUICulture = $initialUICulture
24
+ }
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments