Files
pikasTech-unidesk/scripts/src/ssh-windows-fs/stat.ps1
T
Codex 3a17d3b9fd fix: harden Windows trans helpers
Resolve #1691 by preserving argv boundaries, adding bounded native rg and wc/skill query support, surfacing WSL-to-Windows hints, and splitting the oversized SSH module and embedded remote scripts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-10 13:13:03 +02:00

12 lines
560 B
PowerShell

if ($operation -eq 'stat') {
if ($toolArgs.Count -eq 0) { Fail 'stat requires at least one path on Windows routes' 2 }
[Console]::Out.WriteLine('TYPE BYTES SHA256 PATH')
foreach ($raw in $toolArgs) {
$path = Resolve-UnideskPath $raw
if (-not (Test-Path -LiteralPath $path)) { Fail ('path not found: ' + $path) 1 }
$item = Get-Item -LiteralPath $path
if ($item.PSIsContainer) { [Console]::Out.WriteLine('dir - - ' + $path) } else { [Console]::Out.WriteLine('file ' + $item.Length + ' ' + (Get-Sha256 $path) + ' ' + $path) }
}
exit 0
}