mirror of
https://github.com/JosefNemec/Playnite.git
synced 2026-01-09 06:11:22 +08:00
32 lines
808 B
PowerShell
32 lines
808 B
PowerShell
#Requires -Version 7
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
Add-Type -AssemblyName "PresentationFramework"
|
|
|
|
$locDir = "..\source\Playnite\Localization\"
|
|
$allOk = $true
|
|
foreach ($locFile in (Get-ChildItem $locDir -Filter "*.xaml"))
|
|
{
|
|
$stream = New-Object "System.IO.StreamReader" $locFile.FullName
|
|
|
|
try
|
|
{
|
|
$xaml = [System.Windows.Markup.XamlReader]::Load($stream.BaseStream)
|
|
Write-Host "$($locFile.Name)...OK" -ForegroundColor Green
|
|
}
|
|
catch
|
|
{
|
|
$allOk = $false
|
|
Write-Host "$($locFile.Name)...FAIL" -ForegroundColor Red
|
|
Write-Host $_.Exception.InnerException.Message -ForegroundColor Red
|
|
}
|
|
finally
|
|
{
|
|
$stream.Dispose()
|
|
}
|
|
}
|
|
|
|
if (-not $allOk)
|
|
{
|
|
throw "Some localization files failed verification."
|
|
} |