Skip to content

Commit

Permalink
Fix PrtgAPI.Build unit tests that mock Compress-Archive failing on sy…
Browse files Browse the repository at this point in the history
…stems whose UI Culture is not en-US
  • Loading branch information
lordmilko committed Nov 1, 2022
1 parent 1fc16b4 commit bb5dc68
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/PrtgAPI.Tests.UnitTests/Support/PowerShell/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ function It

Write-LogInfo "Processing test '$name'"

# Microsoft.PowerShell.Archive wants to import a file
# "Microsoft.PowerShell.Archive\en-US\ArchiveResources.psd1"
# however if the current UI Culture is not en-US it will try and look
# for a different culture folder instead

$originalCulture = [Threading.Thread]::CurrentThread.CurrentUICulture

[Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US'

try
{
& $script @args
Expand All @@ -64,6 +73,7 @@ function It
}
finally
{
[Threading.Thread]::CurrentThread.CurrentUICulture = $originalCulture
#RemoveMocks
}
}
Expand Down

0 comments on commit bb5dc68

Please sign in to comment.