mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-26 07:26:18 +01:00
fix: read JSON as UTF-8 so BOM-less packs load correctly (#844)
This commit is contained in:
@@ -30,7 +30,7 @@ function Import-AppDetailsFromJson {
|
||||
|
||||
$apps = @()
|
||||
try {
|
||||
$jsonContent = Get-Content -Path $script:AppsListFilePath -Raw | ConvertFrom-Json
|
||||
$jsonContent = Get-Content -Path $script:AppsListFilePath -Raw -Encoding UTF8 | ConvertFrom-Json
|
||||
}
|
||||
catch {
|
||||
Write-Error "Failed to read Apps.json: $_"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#>
|
||||
function Import-AppPresetsFromJson {
|
||||
try {
|
||||
$jsonContent = Get-Content -Path $script:AppsListFilePath -Raw | ConvertFrom-Json
|
||||
$jsonContent = Get-Content -Path $script:AppsListFilePath -Raw -Encoding UTF8 | ConvertFrom-Json
|
||||
}
|
||||
catch {
|
||||
Write-Warning "Failed to read Apps.json: $_"
|
||||
|
||||
@@ -26,7 +26,7 @@ function Import-AppsFromFile {
|
||||
}
|
||||
|
||||
try {
|
||||
$jsonContent = Get-Content -Path $appsFilePath -Raw | ConvertFrom-Json
|
||||
$jsonContent = Get-Content -Path $appsFilePath -Raw -Encoding UTF8 | ConvertFrom-Json
|
||||
Foreach ($appData in $jsonContent.Apps) {
|
||||
# Handle AppId as array (could be single or multiple IDs)
|
||||
$appIdArray = if ($appData.AppId -is [array]) { $appData.AppId } else { @($appData.AppId) }
|
||||
|
||||
Reference in New Issue
Block a user