diff --git a/libexec/scoop-search.ps1 b/libexec/scoop-search.ps1 index be044513c1..4254099989 100644 --- a/libexec/scoop-search.ps1 +++ b/libexec/scoop-search.ps1 @@ -61,7 +61,15 @@ function search_bucket($bucket, $query) { $apps = Get-ChildItem (Find-BucketDirectory $bucket) -Filter '*.json' -Recurse $apps | ForEach-Object { - $json = [System.Text.Json.JsonDocument]::Parse([System.IO.File]::ReadAllText($_.FullName)) + $filepath = $_.FullName + + $json = try { + [System.Text.Json.JsonDocument]::Parse([System.IO.File]::ReadAllText($filepath)) + } catch { + debug "Failed to parse manifest file: $filepath (error: $_)" + return + } + $name = $_.BaseName if ($name -match $query) {