From 242307cee2bef9f2e41db47bf30b867e5fd60b31 Mon Sep 17 00:00:00 2001 From: Kawa Date: Fri, 21 Aug 2026 13:43:22 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20les=20chemins=20pointant=20vers=20un=20e?= =?UTF-8?q?ndroit=20non-local=20font=20planter=20le=20scan=20qui=20retourn?= =?UTF-8?q?e=20zero=20bytes=20analys=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filer-manager.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/filer-manager.ps1 b/filer-manager.ps1 index 05e5e20..f830368 100644 --- a/filer-manager.ps1 +++ b/filer-manager.ps1 @@ -782,8 +782,16 @@ function Invoke-FilerScan { # Canonicalise the root once. Every child path is derived from this # string, and every length compared against -MaxPathLength is measured on # it, so an 8.3 alias here would understate how long the real paths are. + # ProviderPath, not Path: on a UNC root the latter comes back in + # provider-qualified form ("Microsoft.PowerShell.Core\FileSystem::\\srv\ + # share"), which no Win32 call can open - the scan then found nothing. $fullPath = $p - try { $fullPath = (Resolve-Path -LiteralPath $p).Path } catch { } + try { + $rp = Resolve-Path -LiteralPath $p -ErrorAction Stop + $cand = [string]$rp.ProviderPath + if ([string]::IsNullOrWhiteSpace($cand)) { $cand = [string]$rp.Path } + if ($cand) { $fullPath = $cand } + } catch { } $fullPath = Expand-FilerShortPath -Path $fullPath $node = Get-FolderNode -Path $fullPath -MaxLen $MaxPathLength ` -LongPaths $longPaths -ScanErrors $scanErrors -Progress $Progress